public final class JsonOut extends Object
Handles Map (insertion order preserved), Collection,
arrays, String, Number, Boolean, Enum (as
its lower-case name) and null. Doubles are written with at most
three decimals and no exponent so two runs over the same input produce
byte-identical text.
Package-private on purpose: the JSON contract is owned by
ScoreReport; nothing else should serialise ad hoc.
| Modifier and Type | Method and Description |
|---|---|
static String |
num(double d)
Format a double for the wire: at most 3 decimals, no trailing zeros, no exponent.
|
static void |
quote(StringBuilder sb,
String s) |
static String |
toJson(Object value,
boolean pretty) |