public static interface BrooklynObjectInternal.ConfigurationSupportInternal extends Configurable.ConfigurationSupport
Modifier and Type | Method and Description |
---|---|
java.util.Map<ConfigKey<?>,java.lang.Object> |
getAllLocalRaw()
Returns all config defined here, in
getLocalRaw(ConfigKey) format |
ConfigBag |
getBag()
Returns a read-only view of all the config key/value pairs on this entity, backed by a string-based map,
including config names that did not match anything on this entity.
|
ConfigMap.ConfigMapWithInheritance<? extends BrooklynObject> |
getInternalConfigMap()
This is currently the only way to get some rolled up collections and raw,
and also to test for the presence of a value (without any default).
|
ConfigBag |
getLocalBag()
Returns a read-only view of the local (i.e.
|
Maybe<java.lang.Object> |
getLocalRaw(ConfigKey.HasConfigKey<?> key) |
Maybe<java.lang.Object> |
getLocalRaw(ConfigKey<?> key)
Returns the uncoerced value for this config key, if available,
not following any inheritance chains and not taking any default.
|
<T> Maybe<T> |
getNonBlocking(ConfigKey.HasConfigKey<T> key) |
<T> Maybe<T> |
getNonBlocking(ConfigKey<T> key)
Attempts to coerce the value for this config key, if available,
including returning a default if the config key is unset,
returning a
absent if the uncoerced
does not support immediate resolution. |
Maybe<java.lang.Object> |
getRaw(ConfigKey.HasConfigKey<?> key) |
Maybe<java.lang.Object> |
getRaw(ConfigKey<?> key)
Returns the uncoerced value for this config key, if available, not taking any default.
|
void |
putAll(java.util.Map<?,?> vals)
Adds keys or strings, making anonymous keys from strings; throws on other keys
|
void |
refreshInheritedConfig() |
void |
refreshInheritedConfigOfChildren() |
void |
removeAllLocalConfig()
Clears all local config, e.g.
|
void |
removeKey(ConfigKey<?> key) |
void |
removeKey(java.lang.String key) |
void |
set(java.util.Map<?,?> vals)
Deprecated.
since 0.10.0 use
putAll(Map) instead |
findKeys, findKeysDeclared, findKeysPresent, get, get, set, set, set, set
ConfigBag getBag()
ConfigKey.getInheritanceByContext()
cannot be respected
if an anonymous key (not matching a declared config key) is set but the
strongly typed key is accessed.
It does not identify the container where it is defined, meaning URLs and deferred config values cannot be resolved in the context of the appropriate ancestor.
For these reasons it is recommended to use a different accessor, and callers should be advised this beta method may be removed.
ConfigBag getLocalBag()
java.util.Map<ConfigKey<?>,java.lang.Object> getAllLocalRaw()
getLocalRaw(ConfigKey)
formatMaybe<java.lang.Object> getRaw(ConfigKey<?> key)
Maybe
-wrapped null if the value is explicitly null.
Returns Maybe.absent()
if the key is not explicitly set on this object or an ancestor.
Often this is used with Maybe#or(Object))
to return default value.
See also {@link #getLocalRaw(ConfigKey).
Maybe<java.lang.Object> getRaw(ConfigKey.HasConfigKey<?> key)
#getRaw(ConfigKey)}
Maybe<java.lang.Object> getLocalRaw(ConfigKey<?> key)
Maybe.absent()
if the key is not explicitly set on this object.
See also {@link #getRaw(ConfigKey).
Maybe<java.lang.Object> getLocalRaw(ConfigKey.HasConfigKey<?> key)
#getLocalRaw(ConfigKey)}
<T> Maybe<T> getNonBlocking(ConfigKey<T> key)
absent
if the uncoerced
does not support immediate resolution.
This also returns absent
if the value
or default value cannot be coerced to the type required by the key,
with coercion errors typically handled when setting or when getting
the "really needed" values, not when validating constraints which
is one of the main use cases of this method.
Note: if no value for the key is available, not even as a default,
this returns a Maybe.isPresent()
containing null
(following the semantics of Configurable.ConfigurationSupport.get(ConfigKey)
rather than getRaw(ConfigKey)
).
Thus a Maybe.absent()
definitively indicates that
the absence is due to the request to evaluate immediately.
This will include catching ImmediateSupplier.ImmediateUnsupportedException
and returning it as an absence, thus making the semantics here slightly
"safer" than that of ImmediateSupplier.getImmediately()
.
<T> Maybe<T> getNonBlocking(ConfigKey.HasConfigKey<T> key)
#getNonBlocking(ConfigKey)}
void putAll(java.util.Map<?,?> vals)
@Deprecated void set(java.util.Map<?,?> vals)
putAll(Map)
insteadvoid removeKey(java.lang.String key)
void removeKey(ConfigKey<?> key)
void refreshInheritedConfig()
void refreshInheritedConfigOfChildren()
ConfigMap.ConfigMapWithInheritance<? extends BrooklynObject> getInternalConfigMap()
#findKeysDeclared(com.google.common.base.Predicate)
although efficiency should be considered (this gives direct access whereas that does lookups and copies).void removeAllLocalConfig()