public static void serialize(final boolean value, final JsonWriter sw) { if (value) { sw.writeAscii("true"); } else { sw.writeAscii("false"); } }
public static void serializeNullable(final Boolean value, final JsonWriter sw) { if (value == null) { sw.writeNull(); } else if (value) { sw.writeAscii("true"); } else { sw.writeAscii("false"); } }
public static void serialize(final boolean[] value, final JsonWriter sw) { if (value == null) { sw.writeNull(); } else if (value.length == 0) { sw.writeAscii("[]"); } else { sw.writeByte(JsonWriter.ARRAY_START); sw.writeAscii(value[0] ? "true" : "false"); for (int i = 1; i < value.length; i++) { sw.writeAscii(value[i] ? ",true" : ",false"); } sw.writeByte(JsonWriter.ARRAY_END); } }