Package io.micronaut.core.value
Interface OptionalMultiValues<V>
-
- Type Parameters:
V
- The generic value
- All Superinterfaces:
java.lang.Iterable<java.lang.CharSequence>
,OptionalValues<java.util.List<V>>
public interface OptionalMultiValues<V> extends OptionalValues<java.util.List<V>>
- Since:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field Description static OptionalMultiValues
EMPTY_VALUES
Constant for empty values.
-
Method Summary
All Methods Static Methods Instance Methods Default Methods Modifier and Type Method Description static <T> OptionalMultiValues<T>
empty()
An emptyOptionalValues
.default java.util.Optional<V>
getFirst(java.lang.CharSequence name)
Retrieve a value if it is present.static <T> OptionalMultiValues<T>
of(java.util.Map<java.lang.CharSequence,java.util.List<T>> values)
Creates a newOptionalValues
for the given type and values.-
Methods inherited from interface io.micronaut.core.value.OptionalValues
forEach, get, isEmpty, values
-
-
-
-
Field Detail
-
EMPTY_VALUES
static final OptionalMultiValues EMPTY_VALUES
Constant for empty values.
-
-
Method Detail
-
getFirst
default java.util.Optional<V> getFirst(java.lang.CharSequence name)
Retrieve a value if it is present.- Parameters:
name
- The name of the value- Returns:
- An
Optional
of the value
-
empty
static <T> OptionalMultiValues<T> empty()
An emptyOptionalValues
.- Type Parameters:
T
- The generic type- Returns:
- The empty values
-
of
static <T> OptionalMultiValues<T> of(java.util.Map<java.lang.CharSequence,java.util.List<T>> values)
Creates a newOptionalValues
for the given type and values.- Type Parameters:
T
- The target generic type- Parameters:
values
- A map of values- Returns:
- The values
-
-