public final String toJson(T value) throws IOException {
    StringWriter stringWriter = new StringWriter();
    toJson(stringWriter, value);
    return stringWriter.toString();
  }
public final String toJson(T value) throws IOException {
    StringWriter stringWriter = new StringWriter();
    toJson(stringWriter, value);
    return stringWriter.toString();
  }
public final String toJson ( T value ) throws IOException { StringWriter stringWriter = new StringWriter ( ) ; toJson ( stringWriter , value ) ; return stringWriter . toString ( ) ; }
Converts {@code value} to a JSON document. Unlike Gson's similar {@link
Gson#toJson(Object) toJson} method, this write is strict. Create a {@link
JsonWriter#setLenient(boolean) lenient} {@code JsonWriter} and call
{@link #write(com.socialize.google.gson.stream.JsonWriter, Object)} for lenient
writing.

@param value the Java object to convert. May be null.
@since 2.2
Converts { @code value } to a JSON document . Unlike Gson s similar { @link Gson#toJson ( Object ) toJson } method this write is strict . Create a { @link JsonWriter#setLenient ( boolean ) lenient } { @code JsonWriter } and call { @link #write ( com . socialize . google . gson . stream . JsonWriter Object ) } for lenient writing .