public class HashValue extends Object implements ValueNode, Formdata
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 . |
void |
put(Map<String,Collection<String>> headers) |
void |
put(String path,
Collection<String> values)
Add a form field.
|
void |
put(String path,
String value)
Add a form field.
|
void |
put(String path,
ValueNode node)
Add a form field.
|
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 void put(String path, String value)
Formdata
public void put(String path, ValueNode node)
Formdata
public void put(String path, Collection<String> values)
Formdata
public ValueNode get(@Nonnull String name)
ValueNode
public ValueNode get(@Nonnull int index)
ValueNode
public int size()
ValueNode
0
.public Iterator<ValueNode> iterator()
ValueNode
@Nonnull public List<String> toList()
Value
@Nonnull public Set<String> toSet()
Value
@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
public void put(Map<String,Collection<String>> headers)
Copyright © 2020. All rights reserved.