Interface OptionSchema.Mutable

All Superinterfaces:
OptionSchema
Enclosing interface:
OptionSchema

@NonExtendable public static interface OptionSchema.Mutable extends OptionSchema
A mutable view of an option schema that allows registering new options into the schema.
Since:
1.1.0
  • Method Details

    • stringOption

      Option<String> stringOption(String id, @Nullable String defaultValue)
      Create an option with a string value type.

      Flag keys must not be reused within a schema tree.

      Parameters:
      id - the flag id
      defaultValue - the default value
      Returns:
      the flag instance
      Since:
      1.1.0
    • booleanOption

      Option<Boolean> booleanOption(String id, boolean defaultValue)
      Create an option with a boolean value type.

      Flag keys must not be reused within a schema tree.

      Parameters:
      id - the flag id
      defaultValue - the default value
      Returns:
      the flag instance
      Since:
      1.1.0
    • intOption

      Option<Integer> intOption(String id, int defaultValue)
      Create an option with an integer value type.

      Flag keys must not be reused within a schema tree.

      Parameters:
      id - the flag id
      defaultValue - the default value
      Returns:
      the flag instance
      Since:
      1.1.0
    • doubleOption

      Option<Double> doubleOption(String id, double defaultValue)
      Create an option with a double value type.

      Flag keys must not be reused within a schema tree.

      Parameters:
      id - the flag id
      defaultValue - the default value
      Returns:
      the flag instance
      Since:
      1.1.0
    • enumOption

      <E extends Enum<E>> Option<E> enumOption(String id, Class<E> enumClazz, @Nullable E defaultValue)
      Create an option with an enum value type.

      Flag keys must not be reused within a schema tree.

      Type Parameters:
      E - the enum type
      Parameters:
      id - the flag id
      enumClazz - the value type
      defaultValue - the default value
      Returns:
      the flag instance
      Since:
      1.1.0
    • frozenView

      OptionSchema frozenView()
      Return a view of this schema which does not allow consumers to register new options.

      This allows exposing known options within a schema without the risk of having values polluted.

      Returns:
      the frozen view of this schema
      Since:
      1.1.0