public abstract class BasicOption<T> extends java.lang.Object implements Option<T>, PreferenceableOption<T>
PreferenceableOption.Listener, PreferenceableOption.PreferenceableOption2<T>
Modifier and Type | Field and Description |
---|---|
protected T |
defaultValue |
protected java.lang.String |
key |
protected java.lang.String |
pluginId |
Modifier | Constructor and Description |
---|---|
protected |
BasicOption(java.lang.String pluginId,
java.lang.String key,
T defaultValue) |
Modifier and Type | Method and Description |
---|---|
T |
getDefaultValue()
Obtains the option's default value.
|
java.lang.String |
getKey()
Obtains my string key, which may be used for persistence in a
preference store.
|
java.lang.String |
getPluginId()
Returns the plugin qualifier for the key.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getValueOf
@NonNull protected final java.lang.String pluginId
@NonNull protected final java.lang.String key
protected final T defaultValue
protected BasicOption(@NonNull java.lang.String pluginId, @NonNull java.lang.String key, T defaultValue)
@NonNull public final java.lang.String getKey()
Option
public final T getDefaultValue()
Option
getDefaultValue
in interface PreferenceableOption<T>
getDefaultValue
in interface Option<T>
null
@NonNull public final java.lang.String getPluginId()
PreferenceableOption
getPluginId
in interface PreferenceableOption<T>