Package net.kyori.option.value
Interface ValueType<T>
- Type Parameters:
T- the actual type
public interface ValueType<T>
A possible type for an option value.
- Since:
- 1.1.0
-
Method Summary
Modifier and TypeMethodDescriptionProvide a value type for boolean values.Provide a value type for double values.Provide a value type for enum values.Provide a value type for integer values.Extract a value of this type from a plain string.Provide a value type for string values.type()The type representing the value.
-
Method Details
-
stringType
Provide a value type for string values.- Returns:
- a value type for string values
- Since:
- 1.1.0
-
booleanType
Provide a value type for boolean values.- Returns:
- a value type for boolean values
- Since:
- 1.1.0
-
integerType
Provide a value type for integer values.- Returns:
- a value type for integer values
- Since:
- 1.1.0
-
doubleType
Provide a value type for double values.- Returns:
- a value type for double values
- Since:
- 1.1.0
-
enumType
Provide a value type for enum values.- Type Parameters:
E- the enum type- Parameters:
enumClazz- the enum class- Returns:
- a value type for enum values
- Since:
- 1.1.0
-
type
The type representing the value.- Returns:
- the object type of the value
- Since:
- 1.1.0
-
parse
Extract a value of this type from a plain string.- Parameters:
plainValue- a plain-text value- Returns:
- the value coerced to the correct type
- Throws:
IllegalArgumentException- if the value is not of an appropriate type- Since:
- 1.1.0
-