V
- The generic valuepublic interface OptionalValues<V>
extends java.lang.Iterable<java.lang.CharSequence>
Modifier and Type | Field and Description |
---|---|
static OptionalValues |
EMPTY_VALUES
Constant for empty values.
|
Modifier and Type | Method and Description |
---|---|
static <T> OptionalValues<T> |
empty()
An empty
OptionalValues . |
default void |
forEach(java.util.function.BiConsumer<java.lang.CharSequence,? super V> action)
Performs the given action for each entry in this
OptionalValues until all entries
have been processed or the action throws an exception. |
java.util.Optional<V> |
get(java.lang.CharSequence name)
Retrieve a value if it is present.
|
default boolean |
isEmpty() |
static <T> OptionalValues<T> |
of(java.lang.Class<T> type,
java.util.Map<java.lang.CharSequence,?> values)
Creates a new
OptionalValues for the given type and values. |
java.util.Collection<V> |
values() |
static final OptionalValues EMPTY_VALUES
java.util.Optional<V> get(java.lang.CharSequence name)
name
- The name of the valueOptional
of the valuejava.util.Collection<V> values()
default boolean isEmpty()
OptionalValues
is emptydefault void forEach(java.util.function.BiConsumer<java.lang.CharSequence,? super V> action)
OptionalValues
until all entries
have been processed or the action throws an exception. Unless
otherwise specified by the implementing class, actions are performed in
the order of entry set iteration (if an iteration order is specified.)
Exceptions thrown by the action are relayed to the caller.action
- The action to be performed for each entryjava.lang.NullPointerException
- if the specified action is null
removed during iterationstatic <T> OptionalValues<T> empty()
OptionalValues
.T
- The generic typestatic <T> OptionalValues<T> of(java.lang.Class<T> type, @Nullable java.util.Map<java.lang.CharSequence,?> values)
OptionalValues
for the given type and values.T
- The target generic typetype
- The target typevalues
- A map of values