public enum OutputFormat extends java.lang.Enum<OutputFormat>
Enum Constant and Description |
---|
JSON
Pretty-printed JSON format.
|
JSON_COMPACT
Same as
JSON , but with unnecessary whitespace removed to save
generation time and copy costs. |
TEXT
The output is a human readable text format.
|
Modifier and Type | Method and Description |
---|---|
boolean |
isJson() |
com.google.gson.Gson |
newGson() |
com.google.gson.GsonBuilder |
newGsonBuilder() |
static OutputFormat |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static OutputFormat[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final OutputFormat TEXT
public static final OutputFormat JSON
public static final OutputFormat JSON_COMPACT
JSON
, but with unnecessary whitespace removed to save
generation time and copy costs. Typically JSON_COMPACT format is used by a
browser based HTML client running over the network.public static OutputFormat[] values()
for (OutputFormat c : OutputFormat.values()) System.out.println(c);
public static OutputFormat valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic boolean isJson()
public com.google.gson.GsonBuilder newGsonBuilder()
public com.google.gson.Gson newGson()