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) Deprecated.@Nullable VGet a default value for the option, if any is present.enumOption(String id, Class<E> enumClazz, E defaultValue) Deprecated.For removal since 1.1.0, create new options within anOptionSchemainsteadid()Get the option id.type()Deprecated.for removal since 1.1.0, usevalueType()insteadGet information about the option's value type.
-
Method Details
-
booleanOption
Deprecated.For removal since 1.1.0, create new options within anOptionSchemainsteadCreate 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
@Deprecated static <E extends Enum<E>> Option<E> enumOption(String id, Class<E> enumClazz, E defaultValue) Deprecated.For removal since 1.1.0, create new options within anOptionSchemainsteadCreate 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
String id()Get the option id.This must be unique among options.
- Returns:
- the flag id
- Since:
- 1.0.0
-
type
Deprecated.for removal since 1.1.0, usevalueType()insteadGet the type of the option value.- Returns:
- the value type
- Since:
- 1.0.0
-
valueType
Get information about the option's value type.- Returns:
- the value type
- Since:
- 1.0.0
-
defaultValue
@Nullable V defaultValue()Get a default value for the option, if any is present.- Returns:
- the default value
- Since:
- 1.0.0
-
OptionSchemainstead