V
- The generic valuepublic interface OptionalValues<V> extends Iterable<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(BiConsumer<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. |
Optional<V> |
get(CharSequence name)
Retrieve a value if it is present.
|
default boolean |
isEmpty() |
static <T> OptionalValues<T> |
of(Class<T> type,
Map<CharSequence,?> values)
Creates a new
OptionalValues for the given type and values. |
Collection<V> |
values() |
forEach, iterator, spliterator
static final OptionalValues EMPTY_VALUES
Optional<V> get(CharSequence name)
name
- The name of the valueOptional
of the valueCollection<V> values()
default boolean isEmpty()
OptionalValues
is emptydefault void forEach(BiConsumer<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 entryNullPointerException
- if the specified action is null
removed during iterationstatic <T> OptionalValues<T> empty()
OptionalValues
.T
- The generic typestatic <T> OptionalValues<T> of(Class<T> type, @Nullable Map<CharSequence,?> values)
OptionalValues
for the given type and values.T
- The target generic typetype
- The target typevalues
- A map of values