Serializes the Peer data as a simple JSON map string.
162943
def serialize(self):
        
        return json.dumps({
            "name": self.name,
            "ip": self.ip,
            "port": self.port
        }, sort_keys=True)
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;
    }
1069013
public JSONObject toJson() throws IOException {
    String base64 = new Zip().zip(getDirectory());
    Map<String, String> map = ImmutableMap.of(
      "className", this.getClass().getName(),
      BASE64_JSON_KEY, base64);
    
    return new JSONObject(map);
  }
548419
public JSONObject toJSON() throws JSONException {
        JSONObject json = new JSONObject();

        json.put(JSON_TYPE, this.getType());

        return json;
    }
1101782
def to_json(self):
        """"""
        return {
            'tpm': self.tpm,
            'cm': self.cm,
            'size': self.size,
            'node_labels': self.node_labels
        }
776193
def to_json(self, *args, **kwargs):
        """"""
        return json.dumps(self.serialize(), *args, **kwargs)
970377
private JSONObject map2JSON(JSONObject jo, Map<String, Object> map) {
        for (Entry<String, Object> entry : map.entrySet()) {
            String subkeys = null;
            String key = null;
            Object value = entry.getValue();
            int i = entry.getKey().indexOf(".");
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "raw key, index", new Object[] { entry.getKey(), i });
            }
            if (i > -1) {
                subkeys = entry.getKey().substring(i + 1);
                key = entry.getKey().substring(0, i);
            } else {
                key = entry.getKey();
            }
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "key, subkeys", new Object[] { key, subkeys });
            }
            if (subkeys == null) { // simple key
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "simple key: " + entry.getKey());
                }
                if (value == null) {
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                        Tr.debug(tc, "value is null");
                    }
                    jo.put(key, "null");
                } else if (value instanceof Map) { // value is a Map
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                        Tr.debug(tc, "value is a Map, calling map2JSON", value);
                    }
                    jo.put(key, map2JSON(new JSONObject(), (Map<String, Object>) value));
                } else if (value.getClass().isArray()) { // value is an array
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                        Tr.debug(tc, "value is an array, calling array2JSON", value);
                    }
                    jo.put(key, array2JSON(new JSONArray(), (Object[]) value));
                } else { // else value is a "simple" value
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                        Tr.debug(tc, "simple value, adding to jo", value);
                    }
                    jo.put(key, value);
                }
            } else { // compound key
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "compound key: " + entry.getKey());
                }
                JSONObject jsonSubstruc = (JSONObject) jo.get(key);
                if (jsonSubstruc == null) {
                    jsonSubstruc = new JSONObject();
                    jo.put(key, jsonSubstruc);
                }
                Map<String, Object> submap = new TreeMap<String, Object>();
                submap.put(subkeys, value);
                map2JSON(jsonSubstruc, submap);
            }
        }
        return jo;
    }
135577
@Override
    public String toJSON() {
        final ObjectMapper mapper = buildObjectMapperForSerialization();
        try {
            return mapper.writeValueAsString(this);
        } catch (JsonProcessingException e) {
            throw new IllegalStateException("Object cannot be parsed as JSON.", e);
        }
    }
476086
private Map<String, Object> jsonRepresentation() {
        final Map<String, Object> json = new HashMap<>(getProperties());
        json.put(META_PROP_TYPE, TYPE_BLOB);
        if (blobDigest != null) {
            json.put(PROP_DIGEST, blobDigest);
        }
        else {
            json.put(META_PROP_DATA, getContent());
        }
        return json;
    }
698919
public JSONObject toJSON() {
        JSONObject ret = new JSONObject();
        ret.put("url", url);
        if (env != null) {
            ret.put("env", env);
        }
        return ret;
    }
138173
public Map<String, Object> serialize() {
        Map<String, Object> serverInfo = new HashMap<String, Object>();
        serverInfo.put("totalCount", totalCount);
        serverInfo.put("cursor", cursor);
        serverInfo.put("serviceName", serviceName);
        serverInfo.put("columnNames", columns);
        serverInfo.put("version", version);
        serverInfo.put("id", id);
        serverInfo.put("initialData", data);

        return serverInfo;
    }
456150
public JsonNode toJson() {
		ObjectNode node = new ObjectMapper().createObjectNode();
		node.put("code", code);
		if (format != null) {
			node.put("format", format);
		}
		return node;
	}
919013
def serialize(self, data):
        
        return json.dumps(self._serialize_datetime(data), ensure_ascii=False)
298954
public JSONObject serialize(Map<String, Object> out) {
        JSONObject json = new JSONObject();
        json.put("device_id", deviceId);
        json.put("project_id", projectId);
        out.put("device_id", deviceId);
        out.put("project_id", projectId);
        JSONArray sourcesArr = new JSONArray();
        List<String> sourceNames = new ArrayList<String>(store.keySet());
        Collections.sort(sourceNames);
        for (String k : sourceNames) {
            JSONObject temp = new JSONObject();
            temp.put("name", k);
            JSONArray dataArr = new JSONArray();
            for (DataPoint d : store.get(k)) {
                dataArr.put(d.toJson());
            }
            temp.put("data", dataArr);
            sourcesArr.put(temp);
        }
        json.put("sources", sourcesArr);
        out.put("sources", sourcesArr);
        return json;
    }
91211
def to_json(self):
    """"""
    result = {
        "mapper_handler_spec": self.handler_spec,
        "mapper_input_reader": self.input_reader_spec,
        "mapper_params": self.params,
        "mapper_shard_count": self.shard_count
    }
    if self.output_writer_spec:
      result["mapper_output_writer"] = self.output_writer_spec
    return result
208436
def to_json(self):
        
        capsule = {}
        capsule["Hierarchy"] = []
        for (
            dying,
            (persistence, surviving, saddle),
        ) in self.merge_sequence.items():
            capsule["Hierarchy"].append(
                {
                    "Persistence": persistence,
                    "Dying": dying,
                    "Surviving": surviving,
                    "Saddle": saddle,
                }
            )
        capsule["Partitions"] = []
        base = np.array([None] * len(self.Y))
        for label, items in self.base_partitions.items():
            base[items] = label
        capsule["Partitions"] = base.tolist()

        return json.dumps(capsule, separators=(",", ":"))
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);
  }