protected String getRenderedUserProfile ( final Map < String , Object > model ) { if ( oauthProperties . getUserProfileViewType ( ) == OAuthProperties . UserProfileViewTypes . FLAT ) { val flattened = new LinkedHashMap < String , Object > ( ) ; if ( model . containsKey ( MODEL_ATTRIBUTE_ATTRIBUTES ) ) { val attributes = Map . class . cast ( model . get ( MODEL_ATTRIBUTE_ATTRIBUTES ) ) ; flattened . putAll ( attributes ) ; } model . keySet ( ) . stream ( ) . filter ( k -> ! k . equalsIgnoreCase ( MODEL_ATTRIBUTE_ATTRIBUTES ) ) . forEach ( k -> flattened . put ( k , model . get ( k ) ) ) ; LOGGER . trace ( "Flattened user profile attributes with the final model as [{}]" , model ) ; return OAuth20Utils . toJson ( flattened ) ; } return OAuth20Utils . toJson ( model ) ; }
Gets rendered user profile .