public JsonObject toJsonObject(QueryOrderingProperty property) { JsonObject jsonObject = JsonUtil.createObject(); JsonUtil.addField(jsonObject, RELATION, property.getRelation()); QueryProperty queryProperty = property.getQueryProperty(); if (queryProperty != null) { JsonUtil.addField(jsonObject, QUERY_PROPERTY, queryProperty.getName()); JsonUtil.addField(jsonObject, QUERY_PROPERTY_FUNCTION, queryProperty.getFunction()); } Direction direction = property.getDirection(); if (direction != null) { JsonUtil.addField(jsonObject, DIRECTION, direction.getName()); } if (property.hasRelationConditions()) { JsonArray relationConditionsJson = JsonQueryFilteringPropertyConverter.ARRAY_CONVERTER .toJsonArray(property.getRelationConditions()); JsonUtil.addField(jsonObject, RELATION_CONDITIONS, relationConditionsJson); } return jsonObject; }
public JsonObject toJsonObject(QueryOrderingProperty property) { JsonObject jsonObject = JsonUtil.createObject(); JsonUtil.addField(jsonObject, RELATION, property.getRelation()); QueryProperty queryProperty = property.getQueryProperty(); if (queryProperty != null) { JsonUtil.addField(jsonObject, QUERY_PROPERTY, queryProperty.getName()); JsonUtil.addField(jsonObject, QUERY_PROPERTY_FUNCTION, queryProperty.getFunction()); } Direction direction = property.getDirection(); if (direction != null) { JsonUtil.addField(jsonObject, DIRECTION, direction.getName()); } if (property.hasRelationConditions()) { JsonArray relationConditionsJson = JsonQueryFilteringPropertyConverter.ARRAY_CONVERTER .toJsonArray(property.getRelationConditions()); JsonUtil.addField(jsonObject, RELATION_CONDITIONS, relationConditionsJson); } return jsonObject; }
public JSONObject toJsonObject(QueryOrderingProperty property) { JSONObject jsonObject = new JSONObject(); JsonUtil.addField(jsonObject, RELATION, property.getRelation()); QueryProperty queryProperty = property.getQueryProperty(); if (queryProperty != null) { JsonUtil.addField(jsonObject, QUERY_PROPERTY, queryProperty.getName()); JsonUtil.addField(jsonObject, QUERY_PROPERTY_FUNCTION, queryProperty.getFunction()); } Direction direction = property.getDirection(); if (direction != null) { JsonUtil.addField(jsonObject, DIRECTION, direction.getName()); } if (property.hasRelationConditions()) { JSONArray relationConditionsJson = JsonQueryFilteringPropertyConverter.ARRAY_CONVERTER .toJsonArray(property.getRelationConditions()); JsonUtil.addField(jsonObject, RELATION_CONDITIONS, relationConditionsJson); } return jsonObject; }