Package com.google.gerrit.server
Enum OutputFormat
- java.lang.Object
- 
- java.lang.Enum<OutputFormat>
- 
- com.google.gerrit.server.OutputFormat
 
 
- 
- All Implemented Interfaces:
- Serializable,- Comparable<OutputFormat>
 
 public enum OutputFormat extends Enum<OutputFormat> Standard output format used by an API call.
- 
- 
Enum Constant SummaryEnum Constants Enum Constant Description JSONPretty-printed JSON format.JSON_COMPACTSame asJSON, but with unnecessary whitespace removed to save generation time and copy costs.TEXTThe output is a human readable text format.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisJson()com.google.gson.GsonnewGson()com.google.gson.GsonBuildernewGsonBuilder()static OutputFormatvalueOf(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.
 
- 
- 
- 
Enum Constant Detail- 
TEXTpublic static final OutputFormat TEXT The output is a human readable text format. It may also be regular enough to be machine readable. Whether or not the text format is machine readable and will be committed to as a long term format that tools can build upon is specific to each API call.
 - 
JSONpublic static final OutputFormat JSON Pretty-printed JSON format. This format uses whitespace to make the output readable by a human, but is also machine readable with a JSON library. The structure of the output is a long term format that tools can rely upon.
 - 
JSON_COMPACTpublic static final OutputFormat JSON_COMPACT Same asJSON, 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.
 
- 
 - 
Method Detail- 
valuespublic static OutputFormat[] values() Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (OutputFormat c : OutputFormat.values()) System.out.println(c); - Returns:
- an array containing the constants of this enum type, in the order they are declared
 
 - 
valueOfpublic static OutputFormat valueOf(String name) Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
- name- the name of the enum constant to be returned.
- Returns:
- the enum constant with the specified name
- Throws:
- IllegalArgumentException- if this enum type has no constant with the specified name
- NullPointerException- if the argument is null
 
 - 
isJsonpublic boolean isJson() - Returns:
- true when the format is either JSON or JSON_COMPACT.
 
 - 
newGsonBuilderpublic com.google.gson.GsonBuilder newGsonBuilder() - Returns:
- a new Gson instance configured according to the format.
 
 - 
newGsonpublic com.google.gson.Gson newGson() - Returns:
- a new Gson instance configured according to the format.
 
 
- 
 
-