public final class OptionKey<T> extends Object
| Constructor and Description |
|---|
OptionKey(T defaultValue)
Constructs a new option key given a default value.
|
OptionKey(T defaultValue,
OptionType<T> type)
Constructs a new option key given a default value and option key.
|
| Modifier and Type | Method and Description |
|---|---|
T |
getDefaultValue()
Returns the default value for this option.
|
OptionType<T> |
getType()
Returns the option type of this key.
|
T |
getValue(OptionValues values)
Returns the value of this key given the
values. |
boolean |
hasBeenSet(OptionValues values)
Returns
true if a value for this key has been set for the given option values or
false if no value has been set. |
public OptionKey(T defaultValue)
IllegalArgumentException if
no default OptionType could be resolved for
the given type. The default value must not be null.public OptionKey(T defaultValue, OptionType<T> type)
public OptionType<T> getType()
public T getDefaultValue()
public T getValue(OptionValues values)
values.public boolean hasBeenSet(OptionValues values)
true if a value for this key has been set for the given option values or
false if no value has been set.