Enum OutputFormat

    • Enum Constant Detail

      • TEXT

        public 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.
      • JSON

        public 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_COMPACT

        public static final OutputFormat JSON_COMPACT
        Same as 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.
    • Method Detail

      • values

        public 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
      • valueOf

        public 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
      • isJson

        public boolean isJson()
        Returns:
        true when the format is either JSON or JSON_COMPACT.
      • newGsonBuilder

        public com.google.gson.GsonBuilder newGsonBuilder()
        Returns:
        a new Gson instance configured according to the format.
      • newGson

        public com.google.gson.Gson newGson()
        Returns:
        a new Gson instance configured according to the format.