Get the JSON encoded string representation of the object to be updated.

@return the JSON encoded object
180770
public String getBody() {
        JsonObject wrapper = new JsonObject();
        wrapper.add(Ref.getTypeFromRef(ref), obj);
        return gsonBuilder.create().toJson(wrapper);
    }
614190
@SuppressWarnings("unused")
  public String toJson() {
    Gson gson = new GsonBuilder()
      .registerTypeAdapterFactory(GeocodingAdapterFactory.create())
      .create();
    return gson.toJson(this);
  }
367577
public static String toJSONString(Object o) {
    try {
      return objectMapper.writer().without(SerializationFeature.INDENT_OUTPUT).writeValueAsString(o);
    } catch (JsonProcessingException e) {
      throw new RuntimeException(e);
    }
  }
488476
public String encode() {
    // System.out.println(toJson());
    if (base64 == null)
      base64 = new String(
        Base64.getUrlEncoder().encode(toJson().toString().getBytes(StandardCharsets.UTF_8)),
        StandardCharsets.UTF_8
      );
    return base64;
  }
229825
public JSONObject toJson() {
        JSONObject ret = new JSONObject();
        JSONArray columns = new JSONArray(Arrays.asList(new String[]{"time"}));
        for (String f : this.columns) {
            columns.put(f);
        }
        ret.put(KEY_COLUMNS, columns);

        JSONArray data = new JSONArray();
        ret.put(KEY_ROWS, data);
        for (Long ts : rows.keySet()) {
            JSONArray row = new JSONArray();
            row.put(ts);
            Map<String, Object> temp = rows.get(ts);
            for (String f : this.columns) {
                Object val = temp.get(f);
                row.put(val != null ? val : JSONObject.NULL);
            }
            data.put(row);
        }

        return ret;
    }
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;
  }
919026
@Override
    public String toJson() {
        try {
            return objectMapper.writeValueAsString(status());
        } catch (JsonProcessingException e) {
            throw new RuntimeException(e);
        }
    }
454973
public JSONObject toJson() {
        JSONObject ret = new JSONObject();
        ret.put("url",url);
        if (user != null) {
            ret.put("user",user);
            ret.put("password",password);
        }
        return ret;
    }
10863
public JsonNode toJsonArray() {
		ArrayNode node = new ObjectMapper().createArrayNode();
		for (String value : getAll()) {
			node.add(value);
		}
		return node;
	}
639875
public static String toJsonAsString() {
        logger.entering();
        Gson gson = new GsonBuilder().setPrettyPrinting().create();
        JsonObject configItem = new JsonObject();
        for (Entry<String, Map<String, String>> entry : ReporterConfigMetadata.getReporterMetaData().entrySet()) {
            Map<String, String> subMap = entry.getValue();
            for (Entry<String, String> subEntry : subMap.entrySet()) {
                JsonObject configSubItem = new JsonObject();
                configSubItem.addProperty(subEntry.getKey(), subEntry.getValue());
                configItem.add(entry.getKey(), configSubItem);
            }
        }

        String json = gson.toJson(configItem);
        logger.exiting(json);
        return json;
    }
1345203
@javax.annotation.Nonnull
  public JsonObject getJson() {
    @javax.annotation.Nonnull final JsonObject json = new JsonObject();
    json.addProperty("min", min);
    json.addProperty("max", max);
    json.addProperty("negatives", negatives);
    json.addProperty("positives", positives);
    json.addProperty("zeros", zeros);
    json.addProperty("sum0", sum0);
    json.addProperty("sum1", sum1);
    json.addProperty("sum2", sum2);
    json.addProperty("sumLog", sumLog);
    return json;
  }
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;
    }
1067443
public synchronized String makeJsonString() {
    
    Map<String, Map<String, Long>> data =
        new HashMap<String, Map<String, Long>>();
    
    for (Group group : this) {
      Map<String, Long> groupData = new HashMap<String, Long>();
      data.put(group.getDisplayName(), groupData);
      for (Counter counter : group) {
        groupData.put(counter.getDisplayName(), counter.getCounter());
      }
    }
    return JSON.toString(data);
  }
89327
private byte[] toJSONStringCompressed() {
        String str = toJSONString();
        if (str == null || str.length() == 0) {
            return new byte[0] ;
        }
        byte[] outStr;
        try {
            outStr = compressJSONString(str);
        } catch (IOException e) {
            throw new RuntimeException("Failed to serialize Hashinator Configuration to Compressed JSON .", e);
        }
        return outStr;
    }
10843
public String toJSONString() {
        
        String rawdata = stats.stream().sorted(Comparator.comparingInt(UStats::getIndex))
                .map(sr -> sr.toJSONString())
                .collect(Collectors.joining(",\n    ", "[\n    ", "\n ]"));
        
        String fields = Stream.of(UStats.getJSONFields()).collect(Collectors.joining("\", \"", "[\"", "\"]"));
        
        String models = Stream.of(ScaleDetect.rank(this)).map(me -> me.toJSONString()).collect(Collectors.joining(",\n    ", "[\n    ", "\n  ]"));
        
        return String.format("{ title: \"%s\",\n  nano_tick: %d,\n  models: %s,\n  fields: %s,\n  data: %s\n}",
                title, UUtils.getNanoTick(), models, fields, rawdata);
    }
130039
public JsonObject getJsonObject() {

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

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

        return obj;
    }
1222177
public String toJson() throws IOException {
        ObjectMapper mapper = new ObjectMapper();
        ByteArrayOutputStream out = new ByteArrayOutputStream();

        mapper.writeValue(out, this);
        return out.toString();
    }