public interface CommandValue
Modifier and Type | Method and Description |
---|---|
default <T> com.google.common.collect.ImmutableList<T> |
asMultiple(java.lang.Class<T> key)
Convert the string values using the converted registered under the
given key.
|
<T> com.google.common.collect.ImmutableList<T> |
asMultiple(Key<T> key)
Convert the string values using the converted registered under the
given key.
|
default <T> T |
asSingle(java.lang.Class<T> key)
Convert the string value using the converted registered under the
given key.
|
default <T> T |
asSingle(Key<T> key)
Convert the string value using the converted registered under the
given key.
|
default java.lang.String |
asString()
Get a single string value.
|
com.google.common.collect.ImmutableList<java.lang.String> |
asStrings()
Get all the string values.
|
com.google.common.collect.ImmutableList<java.lang.String> asStrings()
default java.lang.String asString()
java.lang.IllegalStateException
- if not exactly one value is presentdefault <T> com.google.common.collect.ImmutableList<T> asMultiple(java.lang.Class<T> key)
T
- the type of the valueskey
- the key for the converterasMultiple(Key)
<T> com.google.common.collect.ImmutableList<T> asMultiple(Key<T> key)
T
- the type of the valueskey
- the key for the converter@Nullable default <T> T asSingle(java.lang.Class<T> key)
T
- the type of the valuekey
- the key for the converterjava.lang.IllegalStateException
- if not exactly one value is presentasString()
,
asSingle(Key)
@Nullable default <T> T asSingle(Key<T> key)
T
- the type of the valuekey
- the key for the converterjava.lang.IllegalStateException
- if not exactly one value is presentasString()