public class LazyContainerAndKeyValue<TContainer,TValue> extends java.lang.Object implements ConfigValueAtContainer<TContainer,TValue>
| Constructor and Description |
|---|
LazyContainerAndKeyValue(ConfigKey<TValue> key,
TContainer container,
com.google.common.base.Function<TContainer,Maybe<java.lang.Object>> lookupResolutionFunction,
com.google.common.base.Function<Maybe<java.lang.Object>,Maybe<TValue>> conversionFunction) |
| Modifier and Type | Method and Description |
|---|---|
Maybe<TValue> |
asMaybe()
Absent if no value can be found, typically meaning no default value, but in raw value lookups it may ignore default values.
|
TValue |
get()
Returns the value for this key, or null.
|
TContainer |
getContainer()
The container where the value was found (possibly an ancestor of the queried object).
|
Maybe<TValue> |
getDefaultValue()
The default value on the key, if available and permitted,
possibly coerced or resolved in the scope of
ConfigValueAtContainer.getContainer(),
and possibly absent e.g. |
ConfigKey<TValue> |
getKey()
The key whose value is being held here.
|
boolean |
isValueExplicitlySet()
If false, any contents of
ConfigValueAtContainer.get() will have come from ConfigValueAtContainer.getDefaultValue(). |
java.lang.String |
toString() |
public LazyContainerAndKeyValue(@Nullable
ConfigKey<TValue> key,
@Nullable
TContainer container,
com.google.common.base.Function<TContainer,Maybe<java.lang.Object>> lookupResolutionFunction,
com.google.common.base.Function<Maybe<java.lang.Object>,Maybe<TValue>> conversionFunction)
public TContainer getContainer()
ConfigValueAtContainergetContainer in interface ConfigValueAtContainer<TContainer,TValue>public TValue get()
ConfigValueAtContainerConfigValueAtContainer.asMaybe() or null.get in interface com.google.common.base.Supplier<TValue>get in interface ConfigValueAtContainer<TContainer,TValue>public Maybe<TValue> asMaybe()
ConfigValueAtContainerasMaybe in interface ConfigValueAtContainer<TContainer,TValue>public boolean isValueExplicitlySet()
ConfigValueAtContainerConfigValueAtContainer.get() will have come from ConfigValueAtContainer.getDefaultValue().isValueExplicitlySet in interface ConfigValueAtContainer<TContainer,TValue>public ConfigKey<TValue> getKey()
ConfigValueAtContainerThis may be null when working in a context where the query key is widely known to indicate that no key was defined at this container.
getKey in interface ConfigValueAtContainer<TContainer,TValue>public Maybe<TValue> getDefaultValue()
ConfigValueAtContainerConfigValueAtContainer.getContainer(),
and possibly absent e.g. in raw value lookupsgetDefaultValue in interface ConfigValueAtContainer<TContainer,TValue>public java.lang.String toString()
toString in class java.lang.Object