java.lang.Object
org.praxislive.core.Value.Type<T>
- Type Parameters:
T- value subclass
- Enclosing class:
Value
The type of a Value. Only registered types can be used in PraxisCORE.
Type maps to the class or superclass of a Value, and provides additional
features such as simple name and conversion.
-
Method Summary
Modifier and TypeMethodDescriptionasClass()The class that this Type maps to.A convertor function that can convert a value to this type.The empty value of this type, if this type supports empty values, as defined byValue.isEmpty().booleanstatic Optional<Value.Type<? extends Value>> Return the Type with the given name, or an empty optional if unregistered.inthashCode()static List<Value.Type<?>> listAll()List of all registered Value Types.name()Simple name for this Value type.static <T extends Value>
Value.Type<T> Return the Type mapping for the passed in Value class.toString()
-
Method Details
-
asClass
The class that this Type maps to. May be a superclass of the actual class of a Value.- Returns:
- mapped class
-
name
Simple name for this Value type.- Returns:
- type name
-
converter
A convertor function that can convert a value to this type. May cast, parse or otherwise convert the value. An empty Optional is returned if the value does not support conversion to the required type.- Returns:
- optional converted value
-
emptyValue
The empty value of this type, if this type supports empty values, as defined byValue.isEmpty().- Returns:
- optional of empty value
-
toString
-
hashCode
public int hashCode() -
equals
-
of
Return the Type mapping for the passed in Value class.- Type Parameters:
T- value type- Parameters:
cls- value class- Returns:
- Type
- Throws:
IllegalArgumentException- if the class is unregistered
-
fromName
Return the Type with the given name, or an empty optional if unregistered.- Parameters:
name- type name- Returns:
- optional type or empty
-
listAll
List of all registered Value Types. The returned list is read-only.- Returns:
- list of types
-