Package net.kyori.option
Interface OptionSchema.Mutable
- All Superinterfaces:
OptionSchema
- Enclosing interface:
- OptionSchema
A mutable view of an option schema that allows registering new options into the schema.
- Since:
- 1.1.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.kyori.option.OptionSchema
OptionSchema.Mutable -
Method Summary
Modifier and TypeMethodDescriptionbooleanOption(String id, boolean defaultValue) Create an option with a boolean value type.doubleOption(String id, double defaultValue) Create an option with a double value type.enumOption(String id, Class<E> enumClazz, @Nullable E defaultValue) Create an option with an enum value type.Return a view of this schema which does not allow consumers to register new options.Create an option with an integer value type.stringOption(String id, @Nullable String defaultValue) Create an option with a string value type.Methods inherited from interface net.kyori.option.OptionSchema
emptyState, has, knownOptions, stateBuilder, versionedStateBuilder
-
Method Details
-
stringOption
Create an option with a string value type.Flag keys must not be reused within a schema tree.
- Parameters:
id- the flag iddefaultValue- the default value- Returns:
- the flag instance
- Since:
- 1.1.0
-
booleanOption
Create an option with a boolean value type.Flag keys must not be reused within a schema tree.
- Parameters:
id- the flag iddefaultValue- the default value- Returns:
- the flag instance
- Since:
- 1.1.0
-
intOption
Create an option with an integer value type.Flag keys must not be reused within a schema tree.
- Parameters:
id- the flag iddefaultValue- the default value- Returns:
- the flag instance
- Since:
- 1.1.0
-
doubleOption
Create an option with a double value type.Flag keys must not be reused within a schema tree.
- Parameters:
id- the flag iddefaultValue- the default value- Returns:
- the flag instance
- Since:
- 1.1.0
-
enumOption
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 idenumClazz- the value typedefaultValue- 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
-