@Override
    public JSONObject toJsonObject() throws JSONException {

        JSONObject returnVal = super.toJsonObject();

        //User Id...
        if(this.getUserId() != null)
        {
            returnVal.put(JSONMapping.USER_ID, this.getUserId());
        }

        //Name...
        if(this.getName() != null)
        {
            returnVal.put(JSONMapping.NAME, this.getName());
        }

        //Email...
        if(this.getEmail() != null)
        {
            returnVal.put(JSONMapping.EMAIL, this.getEmail());
        }

        //Email Verified...
        returnVal.put(JSONMapping.EMAIL_VERIFIED, this.isEmailVerified());

        //Nickname...
        if(this.getNickname() != null)
        {
            returnVal.put(JSONMapping.NICKNAME, this.getNickname());
        }

        //Picture...
        if(this.getPicture() != null)
        {
            returnVal.put(JSONMapping.PICTURE, this.getPicture());
        }

        //Given Name...
        if(this.getGivenName() != null)
        {
            returnVal.put(JSONMapping.GIVEN_NAME, this.getGivenName());
        }

        //Family Name...
        if(this.getFamilyName() != null)
        {
            returnVal.put(JSONMapping.FAMILY_NAME, this.getFamilyName());
        }

        //Locale...
        if(this.getLocale() != null)
        {
            returnVal.put(JSONMapping.LOCALE, this.getLocale());
        }

        //Identities...
        if(this.getIdentities() != null && !this.getIdentities().isEmpty())
        {
            JSONArray identitiesArr = new JSONArray();
            for(Identity toAdd :this.getIdentities())
            {
                identitiesArr.put(toAdd.toJsonObject());
            }

            returnVal.put(JSONMapping.IDENTITIES,identitiesArr);
        }

        return returnVal;
    }
@Override
    public JSONObject toJsonObject() throws JSONException {

        JSONObject returnVal = super.toJsonObject();

        
        if(this.getUserId() != null)
        {
            returnVal.put(JSONMapping.USER_ID, this.getUserId());
        }

        
        if(this.getName() != null)
        {
            returnVal.put(JSONMapping.NAME, this.getName());
        }

        
        if(this.getEmail() != null)
        {
            returnVal.put(JSONMapping.EMAIL, this.getEmail());
        }

        
        returnVal.put(JSONMapping.EMAIL_VERIFIED, this.isEmailVerified());

        
        if(this.getNickname() != null)
        {
            returnVal.put(JSONMapping.NICKNAME, this.getNickname());
        }

        
        if(this.getPicture() != null)
        {
            returnVal.put(JSONMapping.PICTURE, this.getPicture());
        }

        
        if(this.getGivenName() != null)
        {
            returnVal.put(JSONMapping.GIVEN_NAME, this.getGivenName());
        }

        
        if(this.getFamilyName() != null)
        {
            returnVal.put(JSONMapping.FAMILY_NAME, this.getFamilyName());
        }

        
        if(this.getLocale() != null)
        {
            returnVal.put(JSONMapping.LOCALE, this.getLocale());
        }

        
        if(this.getIdentities() != null && !this.getIdentities().isEmpty())
        {
            JSONArray identitiesArr = new JSONArray();
            for(Identity toAdd :this.getIdentities())
            {
                identitiesArr.put(toAdd.toJsonObject());
            }

            returnVal.put(JSONMapping.IDENTITIES,identitiesArr);
        }

        return returnVal;
    }
@ Override public JSONObject toJsonObject ( ) throws JSONException { JSONObject returnVal = super . toJsonObject ( ) ; //User Id... if ( this . getUserId ( ) != null ) { returnVal . put ( JSONMapping . USER_ID , this . getUserId ( ) ) ; } //Name... if ( this . getName ( ) != null ) { returnVal . put ( JSONMapping . NAME , this . getName ( ) ) ; } //Email... if ( this . getEmail ( ) != null ) { returnVal . put ( JSONMapping . EMAIL , this . getEmail ( ) ) ; } //Email Verified... returnVal . put ( JSONMapping . EMAIL_VERIFIED , this . isEmailVerified ( ) ) ; //Nickname... if ( this . getNickname ( ) != null ) { returnVal . put ( JSONMapping . NICKNAME , this . getNickname ( ) ) ; } //Picture... if ( this . getPicture ( ) != null ) { returnVal . put ( JSONMapping . PICTURE , this . getPicture ( ) ) ; } //Given Name... if ( this . getGivenName ( ) != null ) { returnVal . put ( JSONMapping . GIVEN_NAME , this . getGivenName ( ) ) ; } //Family Name... if ( this . getFamilyName ( ) != null ) { returnVal . put ( JSONMapping . FAMILY_NAME , this . getFamilyName ( ) ) ; } //Locale... if ( this . getLocale ( ) != null ) { returnVal . put ( JSONMapping . LOCALE , this . getLocale ( ) ) ; } //Identities... if ( this . getIdentities ( ) != null && ! this . getIdentities ( ) . isEmpty ( ) ) { JSONArray identitiesArr = new JSONArray ( ) ; for ( Identity toAdd : this . getIdentities ( ) ) { identitiesArr . put ( toAdd . toJsonObject ( ) ) ; } returnVal . put ( JSONMapping . IDENTITIES , identitiesArr ) ; } return returnVal ; }
Conversion to {@code JSONObject} from Java Object.

@return {@code JSONObject} representation of {@code NormalizedUserProfile}
@throws JSONException If there is a problem with the JSON Body.

@see ABaseFluidJSONObject#toJsonObject()
Conversion to { @code JSONObject } from Java Object .