| Modifier and Type | Class and Description |
|---|---|
| private static interface |
| Modifier and Type | Field and Description |
|---|---|
| private final OptionType. | |
| private static final Map | |
| private static final Consumer | |
| private final boolean | |
| private final boolean | |
| private final String | |
| private final Consumer |
| Access | Constructor and Description |
|---|---|
| public | OptionType(String
the name of the type. name, Function<String, T> a function that converts a string value to the option value. Can throw
stringConverter, Consumer<T> IllegalArgumentException to indicate an invalid string.used for validating the option value. Throws
validator)IllegalArgumentException if the value is invalid.Constructs a new option type with name and function that allows to convert a string to the option type and validator of the option values. |
| private | OptionType(String name, OptionType.
|
| private | |
| public | OptionType(String
the name of the type. name, Function<String, T> a function that converts a string value to the option value. Can throw
stringConverter)IllegalArgumentException to indicate an invalid string.Constructs a new option type with name and function that allows to convert a string to the option type. |
| public | OptionType(String name, T defaultValue, Function<String, T> stringConverter, Consumer<T> validator)
Deprecated
since 19.0. Use
OptionType(String, Function, Consumer)
|
| public | OptionType(String name, T defaultValue, Function<String, T> stringConverter)
Deprecated
since 19.0. Use
OptionType(String, Function)
|
| Modifier and Type | Method and Description |
|---|---|
| public T | |
| public T | |
| private static <T> OptionType | |
| public static <T> OptionType | |
| public static <T> OptionType | |
| public T | |
| public String | |
| pack-priv boolean | |
| pack-priv boolean | |
| pack-priv static <V> OptionType | |
| public String | |
| public void | validate(T value)
Validates an option value and throws an |
| converter | back to summary |
|---|---|
| private final OptionType. | |
| DEFAULTTYPES | back to summary |
|---|---|
| private static final Map<Class<?>, OptionType<?>> DEFAULTTYPES | |
| EMPTY_VALIDATOR | back to summary |
|---|---|
| private static final Consumer<?> EMPTY_VALIDATOR | |
| isDefaultType | back to summary |
|---|---|
| private final boolean isDefaultType | |
| isOptionMap | back to summary |
|---|---|
| private final boolean isOptionMap | |
| name | back to summary |
|---|---|
| private final String name | |
| validator | back to summary |
|---|---|
| private final Consumer<T> validator | |
| OptionType | back to summary |
|---|---|
| public OptionType(String name, Function<String, T> stringConverter, Consumer<T> validator) Constructs a new option type with name and function that allows to convert a string to the option type and validator of the option values.
| |
| OptionType | back to summary |
|---|---|
| private OptionType(String name, OptionType. | |
| OptionType | back to summary |
|---|---|
private OptionType(String name, Function<String, T> stringConverter, boolean isDefaultType)
| |
| OptionType | back to summary |
|---|---|
| public OptionType(String name, Function<String, T> stringConverter) Constructs a new option type with name and function that allows to convert a string to the option type.
| |
| OptionType | back to summary |
|---|---|
public OptionType(String name, T defaultValue, Function<String, T> stringConverter, Consumer<T> validator)
| |
| OptionType | back to summary |
|---|---|
public OptionType(String name, T defaultValue, Function<String, T> stringConverter)
| |
| convert | back to summary |
|---|---|
| public T convert(String value) Converts a string value, validates it, and converts it to an object of this type.
| |
| convert | back to summary |
|---|---|
| public T convert(Object previousValue, String nameSuffix, String value) Converts a string value, validates it, and converts it to an object of this type. For option maps includes the previous map stored for the option and the key.
| |
| defaultEnumType | back to summary |
|---|---|
private static <T> OptionType
| |
| defaultType | back to summary |
|---|---|
| public static <T> OptionType Returns the default option type for a given value. Returns
| |
| defaultType | back to summary |
|---|---|
| public static <T> OptionType Returns the default option type for a class. Returns
| |
| getDefaultValue | back to summary |
|---|---|
| public T getDefaultValue()
Deprecated since 19.0.
| |
| getName | back to summary |
|---|---|
| public String getName() Returns the name of this type.
| |
| isDefaultType | back to summary |
|---|---|
| pack-priv boolean isDefaultType() | |
| isOptionMap | back to summary |
|---|---|
| pack-priv boolean isOptionMap() | |
| mapOf | back to summary |
|---|---|
| pack-priv static <V> OptionType Returns the default option type for option maps for the given value class. Returns
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| validate | back to summary |
|---|---|
| public void validate(T value) Validates an option value and throws an
| |
| Modifier and Type | Method and Description |
|---|---|
| public T |
| convert | back to summary |
|---|---|
| public T convert(T previousValue, String key, String value) | |