Package net.kyori.option
Interface Option<V>
- Type Parameters:
V- the value type
@NonExtendable
public interface Option<V>
A representation of a configurable option.
Keys must be unique among all feature flag instances.
- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptionbooleanOption(String id, boolean defaultValue) Create an option with a boolean value type.Get a default value for the option, if any is present.enumOption(String id, Class<E> enumClazz, E defaultValue) Create an option with an enum value type.@NotNull Stringid()Get the option id.type()Get the type of the option value.
-
Method Details
-
booleanOption
Create an option with a boolean value type.Flag keys must not be reused between flag instances.
- Parameters:
id- the flag iddefaultValue- the default value- Returns:
- the flag instance
- Since:
- 1.0.0
-
enumOption
Create an option with an enum value type.Flag keys must not be reused between flag instances.
- Type Parameters:
E- the enum type- Parameters:
id- the flag idenumClazz- the value typedefaultValue- the default value- Returns:
- the flag instance
- Since:
- 1.0.0
-
id
Get the option id.This must be unique among options.
- Returns:
- the flag id
- Since:
- 1.0.0
-
type
Get the type of the option value.- Returns:
- the value type
- Since:
- 1.0.0
-
defaultValue
Get a default value for the option, if any is present.- Returns:
- the default value
- Since:
- 1.0.0
-