Return the JSON string of the response cache. Leverage the Gson nature of
the domain wireline classes

@return the JSON string
288
public String asJSON() {
    Gson gson = new Gson();

    clearExpired();

    Cache jsonCache = new Cache();
    for (ExpiringService svc : cache.values()) {
      jsonCache.cache.add(svc.getService());
    }

    String json = gson.toJson(jsonCache);

    return json;
  }
128317
public function getJSON()
    {
        /* convert to proper types */
        $o = new \stdClass;
        $o->command = (string) $this->command;
        $o->command_id = $this->command_id;
        $o->params = (object) $this->params;
        $o->variables = (object) $this->variables;
        /* json */
        return json_encode($o);
    }
509958
public String toJson() {
        try {
            return JsonSerializer.toString(this);
        } catch (Exception e) {
            String message = String.format("Unformateable JSON search: %s", e.getMessage());
            Log.error(e, message);
            throw new IllegalArgumentException(message, e);
        }
    }
492674
private static Gson getGson() {
		if (gson == null) {
			// Creates the Gson object which will manage the information
			// received
			GsonBuilder builder = new GsonBuilder();

			// Serializes enums as lower-case.
			builder.registerTypeHierarchyAdapter(Enum.class,
					new EnumLowercaseSerializer());

			// Serializes calendar in format YYYY-MM-DDThh:mm.
			builder.registerTypeHierarchyAdapter(Calendar.class,
					new CalendarSerializer());

			// Deserializes payloads from interface.
			builder.registerTypeAdapter(Attachment.class,
					new AttachmentDeserializer());

			// Serializes/deserializes buttons from interface.
			builder.registerTypeAdapter(Button.class, new ButtonSerializer());

			// Deserializes incoming messages from interface.
			builder.registerTypeAdapter(IncomingMessage.class,
					new IncomingMessageDeserializer());

			// Deserializes timestamp as Calendar.
			builder.registerTypeAdapter(Calendar.class,
					new CalendarFromTimestampJsonDeserializer());

			gson = builder.create();
		}
		return gson;
	}
455376
@Override
  public String toJson() {

    Gson gson = new GsonBuilder()
            .registerTypeAdapterFactory(GeoJsonAdapterFactory.create())
            .registerTypeAdapterFactory(GeometryAdapterFactory.create())
            .create();


    // Empty properties -> should not appear in json string
    Feature feature = this;
    if (properties().size() == 0) {
      feature = new Feature(TYPE, bbox(), id(), geometry(), null);
    }

    return gson.toJson(feature);
  }
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);
  }
845570
def json(self):
        
        try:
            return json.loads(self.text)
        except Exception as e:
            raise ContentDecodingError(e)
681950
@Override
    public String toJSONString() {
        Gson gson = new GsonBuilder()
                .excludeFieldsWithoutExposeAnnotation()
                //.registerTypeAdapter(Date.class, new DateSerializer())
                //.setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
                .create();
        return gson.toJson(this);
    }
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;
  }
1096536
public JsonObject toJson() {
        final JsonObjectBuilder builder = Json.createObjectBuilder();
        builder.add(EL_DATA_TYPE, dataType);
        builder.add(EL_DATA_CONTENT_TYPE, dataContentTypeStr);
        if (meta == null) {
            return builder.build();
        }
        builder.add(EL_META_TYPE, metaType);
        builder.add(EL_META_CONTENT_TYPE, metaContentTypeStr);
        if (meta instanceof JsonObject) {
            final JsonObject jo = (JsonObject) meta;
            return builder.add(metaType, jo).build();
        }
        if (meta instanceof ToJsonCapable) {
            final ToJsonCapable tjc = (ToJsonCapable) meta;
            return builder.add(metaType, tjc.toJson()).build();
        }
        if (meta instanceof Base64Data) {
            final Base64Data base64data = (Base64Data) meta;
            return builder.add(metaType, base64data.getEncoded()).build();
        }
        throw new IllegalStateException("Unknown meta object type: " + meta.getClass());
    }
868864
public JSONObject getJson() throws JSONException {
        JSONObject json = create();
        if (value != null)
            json.put("value", value);
        if (label != null)
            json.put("label", label);
        if (type != null)
            json.put("type", type);
        if (display != null)
            json.put("display", display.toString());
        if (sequence != 0)
            json.put("sequence", sequence);
        if (indexKey != null)
            json.put("indexKey", indexKey);
        return json;
    }
904652
public String toJSON() {
        JSONEmitter json = new JSONEmitter();
        json.startDocument();
        toJSON(json);
        json.endDocument();
        return json.toString();
    }
1006831
@Override
  @SuppressWarnings("unused")
  public String toJson() {

    Gson gson = new GsonBuilder()
      .registerTypeAdapterFactory(GeometryAdapterFactory.create())
      .registerTypeAdapter(BoundingBox.class, new BoundingBoxTypeAdapter())
      .registerTypeAdapterFactory(GeocodingAdapterFactory.create())
      .create();

    // Empty properties -> should not appear in json string
    CarmenFeature feature = this;
    if (properties() != null && properties().size() == 0) {
      feature = toBuilder().properties(null).build();
    }

    return gson.toJson(feature, CarmenFeature.class);
  }
976001
private String getCDCQueryJson(CDCQuery cdcQuery) throws SerializationException {
		ObjectMapper mapper = getObjectMapper();
		String json = null;
		try {
			json = mapper.writeValueAsString(cdcQuery);
		} catch (Exception e) {
			throw new SerializationException(e);
		}

		return json;
	}
1294701
def to_json(self):
        
        ret = {
            'address': self.address,
            'domain': self.domain,
            'block_number': self.block_height,
            'sequence': self.n,
            'txid': self.txid,
            'value_hash': get_zonefile_data_hash(self.zonefile_str),
            'zonefile': base64.b64encode(self.zonefile_str),
            'name': self.get_fqn(),
        }
        
        if self.pending is not None:
            ret['pending'] = self.pending

        if self.resolver is not None:
            ret['resolver'] = self.resolver

        return ret
242534
public String toJson() {
        build();
        try {
            return JsonSerializer.toString(this);
        } catch (IOException e) {
            throw new IndexException(e, "Unformateable JSON search: {}", e.getMessage());
        }
    }
26190
public JSONObject toJSON() {
        JSONObject ret = new JSONObject();
        ret.put("type",type.getName());

        if (targetConfig != null) {
            ret.put("target", targetConfig.toJSON());
        }
        if (pathParts != null) {
            try {
                ret.put("path",getPath());
            } catch (UnsupportedOperationException exp) {
                // Happens when request doesnt support paths
            }
        }
        return ret;
    }