Constructor and Description |
---|
SingleValue(Context ctx,
String name,
String value) |
Modifier and Type | Method and Description |
---|---|
ValueNode |
get(int index)
Get a value at the given position.
|
ValueNode |
get(String name)
Get a value that matches the given name.
|
Iterator<ValueNode> |
iterator()
Value iterator.
|
String |
name()
Name of this value or
null . |
int |
size()
The number of values this one has.
|
<T> T |
to(Class<T> type)
Convert this value to the given type.
|
List<String> |
toList()
Get list of values.
|
<T> List<T> |
toList(Class<T> type)
Get list of the given type.
|
Map<String,List<String>> |
toMultimap()
Value as multi-value map.
|
<T> Optional<T> |
toOptional(Class<T> type)
Get a value or empty optional.
|
Set<String> |
toSet()
Get set of values.
|
<T> Set<T> |
toSet(Class<T> type)
Get set of the given type.
|
String |
toString() |
String |
value()
Get string value.
|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
array, booleanValue, booleanValue, byteValue, byteValue, create, create, doubleValue, doubleValue, floatValue, floatValue, hash, intValue, intValue, isArray, isMissing, isObject, isSingle, longValue, longValue, missing, toEnum, toEnum, toMap, toOptional, value, value, value, valueOrNull
public ValueNode get(@Nonnull int index)
ValueNode
public ValueNode get(@Nonnull String name)
ValueNode
public int size()
ValueNode
0
.public Iterator<ValueNode> iterator()
ValueNode
@Nonnull public <T> List<T> toList(@Nonnull Class<T> type)
Value
@Nonnull public <T> Set<T> toSet(@Nonnull Class<T> type)
Value
@Nonnull public <T> Optional<T> toOptional(@Nonnull Class<T> type)
Value
toOptional
in interface Value
T
- Item type.type
- Item type.@Nonnull public <T> T to(@Nonnull Class<T> type)
Value
public Map<String,List<String>> toMultimap()
Value
toMultimap
in interface Value
Copyright © 2019. All rights reserved.