fluid-api/src/main/java/com/fluidbpm/program/api/vo/userquery/UserQuery.java
@Override
    public JSONObject toJsonObject() throws JSONException {

        JSONObject returnVal = super.toJsonObject();

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

        //Description...
        if(this.getDescription() != null)
        {
            returnVal.put(JSONMapping.DESCRIPTION,this.getDescription());
        }

        //Inputs...
        if(this.getInputs() != null)
        {
            JSONArray jsonArray = new JSONArray();

            for(Field toAdd : this.getInputs())
            {
                jsonArray.put(toAdd.toJsonObject());
            }

            returnVal.put(JSONMapping.INPUTS, jsonArray);
        }

        //Rules...
        if(this.getRules() != null)
        {
            JSONArray jsonArray = new JSONArray();

            for(String toAdd : this.getRules())
            {
                jsonArray.put(toAdd);
            }

            returnVal.put(JSONMapping.RULES, jsonArray);
        }

        //Date Created...
        if(this.getDateCreated() != null)
        {
            returnVal.put(JSONMapping.DATE_CREATED,
                    this.getDateAsLongFromJson(this.getDateCreated()));
        }

        //Date Last Updated...
        if(this.getDateLastUpdated() != null)
        {
            returnVal.put(JSONMapping.DATE_LAST_UPDATED,
                    this.getDateAsLongFromJson(this.getDateLastUpdated()));
        }

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

        JSONObject returnVal = super.toJsonObject();

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

        //Description...
        if(this.getDescription() != null)
        {
            returnVal.put(JSONMapping.DESCRIPTION,this.getDescription());
        }

        //Inputs...
        if(this.getInputs() != null)
        {
            JSONArray jsonArray = new JSONArray();

            for(Field toAdd : this.getInputs())
            {
                jsonArray.put(toAdd.toJsonObject());
            }

            returnVal.put(JSONMapping.INPUTS, jsonArray);
        }

        //Rules...
        if(this.getRules() != null)
        {
            JSONArray jsonArray = new JSONArray();

            for(String toAdd : this.getRules())
            {
                jsonArray.put(toAdd);
            }

            returnVal.put(JSONMapping.RULES, jsonArray);
        }

        //Date Created...
        if(this.getDateCreated() != null)
        {
            returnVal.put(JSONMapping.DATE_CREATED,
                    this.getDateAsLongFromJson(this.getDateCreated()));
        }

        //Date Last Updated...
        if(this.getDateLastUpdated() != null)
        {
            returnVal.put(JSONMapping.DATE_LAST_UPDATED,
                    this.getDateAsLongFromJson(this.getDateLastUpdated()));
        }

        return returnVal;
    }
@ Override public JSONObject toJsonObject ( ) throws JSONException { JSONObject returnVal = super . toJsonObject ( ) ; //Name... if ( this . getName ( ) != null ) { returnVal . put ( JSONMapping . NAME , this . getName ( ) ) ; } //Description... if ( this . getDescription ( ) != null ) { returnVal . put ( JSONMapping . DESCRIPTION , this . getDescription ( ) ) ; } //Inputs... if ( this . getInputs ( ) != null ) { JSONArray jsonArray = new JSONArray ( ) ; for ( Field toAdd : this . getInputs ( ) ) { jsonArray . put ( toAdd . toJsonObject ( ) ) ; } returnVal . put ( JSONMapping . INPUTS , jsonArray ) ; } //Rules... if ( this . getRules ( ) != null ) { JSONArray jsonArray = new JSONArray ( ) ; for ( String toAdd : this . getRules ( ) ) { jsonArray . put ( toAdd ) ; } returnVal . put ( JSONMapping . RULES , jsonArray ) ; } //Date Created... if ( this . getDateCreated ( ) != null ) { returnVal . put ( JSONMapping . DATE_CREATED , this . getDateAsLongFromJson ( this . getDateCreated ( ) ) ) ; } //Date Last Updated... if ( this . getDateLastUpdated ( ) != null ) { returnVal . put ( JSONMapping . DATE_LAST_UPDATED , this . getDateAsLongFromJson ( this . getDateLastUpdated ( ) ) ) ; } return returnVal ; }
Conversion to {@code JSONObject} from Java Object.

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

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