Generates the JSON object storing the pattern information.
@return the JSON object storing the pattern information.
@throws JSONException if JSON creation fails.
481059
private JSONObject patternToJson() throws JSONException {

        JSONObject pattern = new JSONObject();
        if (null != getPatternType()) {
            pattern.putOpt(JsonKey.PATTERN_TYPE, getPatternType().toString());
            switch (getPatternType()) {
                case DAILY:
                    if (isEveryWorkingDay()) {
                        pattern.put(JsonKey.PATTERN_EVERYWORKINGDAY, true);
                    } else {
                        pattern.putOpt(JsonKey.PATTERN_INTERVAL, String.valueOf(getInterval()));
                    }
                    break;
                case WEEKLY:
                    pattern.putOpt(JsonKey.PATTERN_INTERVAL, String.valueOf(getInterval()));
                    pattern.putOpt(JsonKey.PATTERN_WEEKDAYS, toJsonStringArray(getWeekDays()));
                    break;
                case MONTHLY:
                    pattern.putOpt(JsonKey.PATTERN_INTERVAL, String.valueOf(getInterval()));
                    if (null != getWeekDay()) {
                        pattern.putOpt(JsonKey.PATTERN_WEEKS_OF_MONTH, toJsonStringArray(getWeeksOfMonth()));
                        pattern.putOpt(JsonKey.PATTERN_WEEKDAYS, toJsonStringArray(getWeekDays()));
                    } else {
                        pattern.putOpt(JsonKey.PATTERN_DAY_OF_MONTH, "" + getDayOfMonth());
                    }
                    break;
                case YEARLY:
                    pattern.put(JsonKey.PATTERN_MONTH, getMonth().toString());
                    if (null != getWeekDay()) {
                        pattern.putOpt(JsonKey.PATTERN_WEEKS_OF_MONTH, toJsonStringArray(getWeeksOfMonth()));
                        pattern.putOpt(JsonKey.PATTERN_WEEKDAYS, toJsonStringArray(getWeekDays()));
                    } else {
                        pattern.putOpt(JsonKey.PATTERN_DAY_OF_MONTH, "" + getDayOfMonth());
                    }
                    break;
                case INDIVIDUAL:
                    pattern.putOpt(JsonKey.PATTERN_DATES, datesToJson(getIndividualDates()));
                    break;
                case NONE:
                default:
                    break;
            }
        }
        return pattern;
    }
1286225
public String toJson() {
        Map<String, Object> data = toMap();
        return SerializationUtils.toJsonString(data);
    }
622268
public JSONObject getJson() throws JSONException {
        JSONObject json = create();
        json.put("id", getLogicalId());
        json.put("to", "A" + toId);
        if (completionCode != null)
            json.put("resultCode", completionCode);
        if (eventType != null)
            json.put("event", EventType.getEventTypeName(eventType));
        if (attributes != null && ! attributes.isEmpty())
            json.put("attributes", Attribute.getAttributesJson(attributes));
        return json;
    }
99339
public String toJson() {
    GsonBuilder gson = new GsonBuilder();
    gson.registerTypeAdapterFactory(DirectionsAdapterFactory.create());
    gson.registerTypeAdapter(Point.class, new PointAsCoordinatesTypeAdapter());
    return gson.create().toJson(this);
  }
551676
public JSONObject getRawDataAsJson() throws IOException
    {
        String input = getRawDataAsString();
        if ( input == null ) {
            return null;
        }
        
        return new JSONObject(input);
    }
673601
public JsonObject toJson() {
    JsonObject body = new JsonObject();
    body.add(JsonRpcProtocol.ID, id());

    if (isError()) {
      body.add(JsonRpcProtocol.ERROR, error().toJson());
    } else {
      body.add(JsonRpcProtocol.RESULT, result());
    }
    return body;
  }
628187
@Override
	public String toJSONString(int indentFactor) throws JSONException {
		final StringWriter w = new StringWriter();
		return this.write(w, indentFactor, 0).toString();
	}
1117300
public String toJson() {
        logger.entering();

        parseResults();

        Gson gson = new GsonBuilder().setPrettyPrinting().create();
        String json = gson.toJson(this);
        logger.exiting(json);
        return json;
    }
130039
public JsonObject getJsonObject() {

        JsonObject obj = new JsonObject();
        obj.add("field", this.field);

        obj.add("value", this.value);

        return obj;
    }
919026
@Override
    public String toJson() {
        try {
            return objectMapper.writeValueAsString(status());
        } catch (JsonProcessingException e) {
            throw new RuntimeException(e);
        }
    }
10863
public JsonNode toJsonArray() {
		ArrayNode node = new ObjectMapper().createArrayNode();
		for (String value : getAll()) {
			node.add(value);
		}
		return node;
	}
724650
public JSONObject jsonify() {
    JSONObject ret = new JSONObject();
    if (null != this._attributesString) {
      for (Map.Entry<ApplicationProperty,CharSequence> entry: this._attributesString.entrySet()) {
        ret.put(entry.getKey().propertyName(), entry.getValue().toString());
      }
    }
    if (null != this._attributesBool) {
      for (Map.Entry<ApplicationProperty,Boolean> entry: this._attributesBool.entrySet()) {
        ret.put(entry.getKey().propertyName(), entry.getValue());
      }
    }
    return ret;
  }
968538
public JSONObject toJson() throws JSONException {

        JSONObject result = new JSONObject();
        if (m_detailId != null) {
            result.put(JSON_DETAIL, "" + m_detailId);
        }
        if (m_siteRoot != null) {
            result.put(JSON_SITEROOT, m_siteRoot);
        }
        if (m_structureId != null) {
            result.put(JSON_STRUCTUREID, "" + m_structureId);
        }
        if (m_projectId != null) {
            result.put(JSON_PROJECT, "" + m_projectId);
        }
        if (m_type != null) {
            result.put(JSON_TYPE, "" + m_type.getJsonId());
        }
        return result;
    }
1033219
public JSONObject toJSON() {
        JSONObject ret = super.toJSON();
        if (arguments != null && arguments.size() > 0) {
            ret.put("arguments", arguments);
        }
        ret.put("operation", operation);
        return ret;
    }
1264606
Object asJSON() {
        final List<Object> json = new ArrayList<>();
        for (Join join : joins) { json.add(join.asJSON()); }
        return json;
    }
588066
public String toJson() {
      try {
         Resource stringResource = Resources.fromString();
         write(stringResource);
         return stringResource.readToString().trim();
      } catch (IOException e) {
         throw Throwables.propagate(e);
      }
   }
502222
public String toJson()
      throws IOException {
    StringWriter writer = new StringWriter();
    try (JsonGenerator generator = jsonFactory.createJsonGenerator(writer)
        .setCodec(objectMapper)) {
      toJsonUtf8(generator);
    }

    return writer.toString();
  }