Package org.tomlj

Enum Class JsonOptions

All Implemented Interfaces:
Serializable, Comparable<JsonOptions>, Constable

public enum JsonOptions extends Enum<JsonOptions>
Options for serializing TOML to JSON.

These options are suitable for use with `toJson` methods, e.g. TomlTable.toJson(JsonOptions...), TomlArray.toJson(JsonOptions...).

  • Enum Constant Details

    • VALUES_AS_OBJECTS_WITH_TYPE

      public static final JsonOptions VALUES_AS_OBJECTS_WITH_TYPE
      Output values as objects including a "type" and "value" property. E.g.:

      { "type": "string", "value": "hello world" }

    • ALL_VALUES_AS_STRINGS

      public static final JsonOptions ALL_VALUES_AS_STRINGS
      Output all values as strings, rather than using integer, float or boolean values.
  • Constructor Details

    • JsonOptions

      private JsonOptions()
  • Method Details

    • values

      public static JsonOptions[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static JsonOptions valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null
    • setFrom

      static EnumSet<JsonOptions> setFrom(JsonOptions[] options)