public void write(String name, short value) throws IOException { writeName(name); out.write(String.valueOf(value)); separator = JSON_SEPARATOR; }
public void write(String name, Boolean value) throws IOException { if (value == null) { return; } writeName(name); out.write(String.valueOf(value)); separator = JSON_SEPARATOR; }
public void write(String name, int value) throws IOException { writeName(name); out.write(String.valueOf(value)); separator = JSON_SEPARATOR; }
public void write(String name, Short value) throws IOException { if (value == null) { return; } writeName(name); out.write(String.valueOf(value)); separator = JSON_SEPARATOR; }
public void write(String name, boolean value) throws IOException { writeName(name); out.write(String.valueOf(value)); separator = JSON_SEPARATOR; }
public void write(String name, Integer value) throws IOException { if (value == null) { return; } writeName(name); out.write(String.valueOf(value)); separator = JSON_SEPARATOR; }
public void write(String name, long value) throws IOException { writeName(name); out.write(String.valueOf(value)); separator = JSON_SEPARATOR; }
public void write(String name, Long value) throws IOException { if (value == null) { return; } writeName(name); out.write(String.valueOf(value)); separator = JSON_SEPARATOR; }
public void write(String name, Double value) throws IOException { if (value == null) { return; } writeName(name); out.write(Double.isNaN(value) || Double.isInfinite(value) ? "0.0" : String.valueOf(value)); separator = JSON_SEPARATOR; }
public void write(String name, com.microsoft.applicationinsights.internal.schemav2.SeverityLevel value) throws IOException { if (value != null) { writeName(name); out.write(JSON_COMMA); out.write(String.valueOf(value)); out.write(JSON_COMMA); separator = JSON_SEPARATOR; } }
public void write(String name, double value) throws IOException { writeName(name); out.write(Double.isNaN(value) || Double.isInfinite(value) ? "0.0" : String.valueOf(value)); separator = JSON_SEPARATOR; }
private void writeToJson(String name, String value, int len) throws IOException { writeName(name); out.write(JSON_COMMA); String sanitizedValue = sanitizeStringForJSON(value, len); out.write(sanitizedValue); out.write(JSON_COMMA); separator = JSON_SEPARATOR; }
public void write(String name, Duration value) throws IOException { writeName(name); write(String.valueOf(value)); separator = JSON_SEPARATOR; }
public void write(String name, DataPointType value) throws IOException { if (value != null) { writeName(name); out.write(String.valueOf(value.getValue())); separator = JSON_SEPARATOR; } }
public <T> void write(String name, List<T> list) throws IOException { if (list == null) { return; } writeName(name); try { if (list.size() < 1) { out.write("null"); } else { out.write(JSON_START_ARRAY); separator = ""; for (T item : list) { out.write(separator); write(item); separator = JSON_SEPARATOR; } out.write(JSON_CLOSE_ARRAY); } } finally { separator = JSON_SEPARATOR; } }
public <T> void write(String name, Map<String, T> map) throws IOException { if (map == null) { return; } writeName(name); try { if (map.size() < 1) { out.write("null"); } else { out.write(JSON_START_OBJECT); separator = ""; for (Map.Entry<String, T> entry : map.entrySet()) { writeName(sanitizeKey(entry.getKey())); write(entry.getValue()); separator = JSON_SEPARATOR; } out.write(JSON_CLOSE_OBJECT); } } finally { separator = JSON_SEPARATOR; } }
public <T extends JsonSerializable> void write(String name, T value) throws IOException { if (value == null) { return; } String jsonStringToAppend = createJsonFor(value); if (Strings.isNullOrEmpty(jsonStringToAppend)) { return; } writeName(name); out.write(jsonStringToAppend); separator = JSON_SEPARATOR; }
public void write(String name, Date value) throws IOException { if (value == null) { return; } writeName(name); write(LocalStringsUtils.getDateFormatter().format(value)); separator = JSON_SEPARATOR; }