Code example for JsonPrimitive

0
    put(JsonNull.INSTANCE);
    return this;
  } 
 
  @Override public JsonWriter value(boolean value) throws IOException {
    put(new JsonPrimitive(value));
    return this;
  } 
 
  @Override public JsonWriter value(double value) throws IOException {
    if (!isLenient() && (Double.isNaN(value) || Double.isInfinite(value))) {
      throw new IllegalArgumentException("JSON forbids NaN and infinities: " + value);
    } 
    put(new JsonPrimitive(value));
    return this;
  } 
 
  @Override public JsonWriter value(long value) throws IOException {
    put(new JsonPrimitive(value));
    return this;