Interface Parameter.Key<T>
-
- Type Parameters:
T
- The type.
- Enclosing interface:
- Parameter
public static interface Parameter.Key<T>
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
Parameter.Key.Builder
A "builder" that allows for keys to be built.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description T
cast(java.lang.Object value)
Cast the provided value to the value type.boolean
isInstance(java.lang.Object value)
Return whether the value is an instance of this key's value type.java.lang.String
key()
Gets the string key associated with this parameter.java.lang.reflect.Type
type()
Gets theTypeToken
of the type of object that this parameter should return from parsing.
-
-
-
Method Detail
-
key
java.lang.String key()
Gets the string key associated with this parameter.- Returns:
- The key.
-
type
java.lang.reflect.Type type()
Gets theTypeToken
of the type of object that this parameter should return from parsing.- Returns:
- The
TypeToken
-
isInstance
boolean isInstance(java.lang.Object value)
Return whether the value is an instance of this key's value type.- Parameters:
value
- value to check- Returns:
- if instance
-
cast
T cast(java.lang.Object value)
Cast the provided value to the value type.- Parameters:
value
- value- Returns:
- the casted value
- Throws:
java.lang.ClassCastException
- ifvalue
is not of the correct type
-
-