V
- The generic valuepublic interface ConvertibleMultiValues<V> extends ConvertibleValues<java.util.List<V>>
ConvertibleValues
where each name has multiple possible values.EMPTY
Modifier and Type | Method and Description |
---|---|
static <V> ConvertibleMultiValues<V> |
empty()
An empty
ConvertibleValues . |
default void |
forEach(java.util.function.BiConsumer<java.lang.String,java.util.List<V>> action)
Performs the given action for each value.
|
default void |
forEachValue(java.util.function.BiConsumer<java.lang.String,V> action)
Performs the given action for each header.
|
V |
get(java.lang.CharSequence name)
Get a value without applying any conversion.
|
java.util.List<V> |
getAll(java.lang.CharSequence name)
Get all the values for the given name without applying conversion.
|
default java.util.Optional<V> |
getFirst(java.lang.CharSequence name)
Get the first value of the given header.
|
default <T> java.util.Optional<T> |
getFirst(java.lang.CharSequence name,
Argument<T> requiredType)
Find a header and convert it to the given type.
|
default <T> java.util.Optional<T> |
getFirst(java.lang.CharSequence name,
ArgumentConversionContext<T> conversionContext)
Find a header and convert it to the given type.
|
default <T> java.util.Optional<T> |
getFirst(java.lang.CharSequence name,
java.lang.Class<T> requiredType)
Find a header and convert it to the given type.
|
default <T> T |
getFirst(java.lang.CharSequence name,
java.lang.Class<T> requiredType,
T defaultValue)
Find a header and convert it to the given type.
|
default boolean |
isEmpty() |
default java.util.Iterator<java.util.Map.Entry<java.lang.String,java.util.List<V>>> |
iterator() |
static <T> ConvertibleMultiValues<T> |
of(java.util.Map<java.lang.CharSequence,java.util.List<T>> values)
Creates a new
OptionalValues for the given type and values. |
asMap, asMap, asProperties, contains, getValue, getValueType, names, of, subMap, subMap, subMap, values
get, get, get, get
java.util.List<V> getAll(java.lang.CharSequence name)
name
- The header name@Nullable V get(java.lang.CharSequence name)
name
- The name of the valuegetFirst(CharSequence)
default boolean isEmpty()
isEmpty
in interface ConvertibleValues<java.util.List<V>>
default void forEachValue(java.util.function.BiConsumer<java.lang.String,V> action)
action
- The action to be performed for each entryjava.lang.NullPointerException
- if the specified action is nulldefault void forEach(java.util.function.BiConsumer<java.lang.String,java.util.List<V>> action)
ConvertibleValues
forEach
in interface ConvertibleValues<java.util.List<V>>
action
- The action to be performed for each entrydefault java.util.Iterator<java.util.Map.Entry<java.lang.String,java.util.List<V>>> iterator()
iterator
in interface ConvertibleValues<java.util.List<V>>
iterator
in interface java.lang.Iterable<java.util.Map.Entry<java.lang.String,java.util.List<V>>>
default java.util.Optional<V> getFirst(java.lang.CharSequence name)
name
- The header namedefault <T> java.util.Optional<T> getFirst(java.lang.CharSequence name, java.lang.Class<T> requiredType)
T
- The generic typename
- The name of the headerrequiredType
- The required typeOptional.empty()
default <T> java.util.Optional<T> getFirst(java.lang.CharSequence name, Argument<T> requiredType)
T
- The generic typename
- The name of the headerrequiredType
- The required typeOptional.empty()
default <T> java.util.Optional<T> getFirst(java.lang.CharSequence name, ArgumentConversionContext<T> conversionContext)
T
- The generic typename
- The name of the headerconversionContext
- The conversion contextOptional.empty()
default <T> T getFirst(java.lang.CharSequence name, java.lang.Class<T> requiredType, T defaultValue)
T
- The generic typename
- The name of the headerrequiredType
- The required typedefaultValue
- The default valuestatic <T> ConvertibleMultiValues<T> of(java.util.Map<java.lang.CharSequence,java.util.List<T>> values)
OptionalValues
for the given type and values.T
- The target generic typevalues
- A map of valuesstatic <V> ConvertibleMultiValues<V> empty()
ConvertibleValues
.empty
in interface ConvertibleValues<java.util.List<V>>
V
- The generic typeConvertibleValues