public final class MergedValueAccess extends java.lang.Object implements InjectedValueAccess
InjectedValueStore
instances.
Order matters.
This does not perform caching, so it may be wise to wrap it in a MemoizingValueAccess
.
EMPTY
Modifier and Type | Method and Description |
---|---|
<T> java.util.Optional<T> |
injectedValue(Key<T> key,
InjectedValueAccess context)
Get an injected value, resolving other injected values under the given context.
|
static MergedValueAccess |
of(java.util.Collection<? extends InjectedValueAccess> delegates) |
static MergedValueAccess |
of(InjectedValueAccess... delegates) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
injectedValue
public static MergedValueAccess of(InjectedValueAccess... delegates)
public static MergedValueAccess of(java.util.Collection<? extends InjectedValueAccess> delegates)
public <T> java.util.Optional<T> injectedValue(Key<T> key, InjectedValueAccess context)
InjectedValueAccess
Provide value injectors to a store.
This alternative to InjectedValueAccess.injectedValue(Key)
is provided mostly for
wrapping classes to function properly.
injectedValue
in interface InjectedValueAccess
Optional.empty()
if not providedInjectedValueStore.injectValue(Key, ValueProvider)