public abstract class AbstractConfigMapImpl<TContainer extends BrooklynObject> extends java.lang.Object implements ConfigMap.ConfigMapWithInheritance<TContainer>
ConfigMap.ConfigMapWithInheritance<TContainer>
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,java.lang.Object> |
asMapWithStringKeys()
returns a read-only map view which has string keys (corresponding to the config key names);
callers encouraged to use the typed keys (and so not use this method),
but in some compatibility areas having a Properties-like view is useful
|
java.util.Set<ConfigKey<?>> |
findKeys(<any> filter)
Deprecated.
|
java.util.Set<ConfigKey<?>> |
findKeysDeclared(<any> filter)
returns all keys present in the map matching the given filter predicate; see ConfigPredicates for common predicates.
|
java.util.Set<ConfigKey<?>> |
findKeysPresent(<any> filter)
as
#findKeysDeclared(Predicate) but restricted to keys actually present in the map |
java.util.Map<ConfigKey<?>,java.lang.Object> |
getAllConfig()
Deprecated.
|
ConfigBag |
getAllConfigBag()
Deprecated.
|
java.util.Map<ConfigKey<?>,java.lang.Object> |
getAllConfigInheritedRawValuesIgnoringErrors()
as
ConfigMap.ConfigMapWithInheritance.getAllConfigInheritedRawWithErrors() but simplified API, just giving values, ignoring any errors |
java.util.Map<ConfigKey<?>,ReferenceWithError<ConfigValueAtContainer<TContainer,?>>> |
getAllConfigInheritedRawWithErrors()
returns a read-only map of all config keys local and inherited together with best-effort raw values
as per
ConfigMap.ConfigMapWithInheritance.getConfigAllInheritedRaw(ConfigKey) |
java.util.Map<ConfigKey<?>,java.lang.Object> |
getAllConfigLocalRaw()
returns a read-only map of all local config keys with their raw (unresolved+uncoerced) contents
|
java.util.Map<ConfigKey<?>,ReferenceWithError<ConfigValueAtContainer<TContainer,?>>> |
getAllReinheritableConfigRaw()
as
#getAllConfigInheritedRaw() but removes any entries which should not be re-inheritable by descendants |
<T> T |
getConfig(ConfigKey.HasConfigKey<T> key) |
<T> T |
getConfig(ConfigKey<T> key) |
java.util.List<ConfigValueAtContainer<TContainer,?>> |
getConfigAllInheritedRaw(ConfigKey<?> queryKey)
As
ConfigMap.getConfigLocalRaw(ConfigKey) but returning all containers through the inheritance
hierarchy where a value is set (but stopping if it encounters a key is not inheritable from a container). |
<T> ReferenceWithError<ConfigValueAtContainer<TContainer,T>> |
getConfigAndContainer(ConfigKey<T> key)
Returns the container where a given key is defined, in addition to the value and data on the key it is defined against,
wrapped in something which will report any error during evaluation (in some cases these errors may otherwise
be silently ignored)
|
ReferenceWithError<ConfigValueAtContainer<TContainer,?>> |
getConfigInheritedRaw(ConfigKey<?> key)
As
ConfigMap.getConfigLocalRaw(ConfigKey) but respecting the inheritance rules. |
Maybe<java.lang.Object> |
getConfigLocalRaw(ConfigKey<?> key)
returns the value stored against the given key,
not any default,
not inherited (if there is an inheritance hierarchy),
not type-coerced or further resolved (eg a task or supplier, if such rules are applicable)
|
Maybe<java.lang.Object> |
getConfigRaw(ConfigKey<?> key,
boolean includeInherited)
Deprecated.
|
TContainer |
getContainer() |
ConfigBag |
getLocalConfigBag()
As
#getLocalConfigRaw() but in a ConfigBag for convenience |
boolean |
isEmpty() |
void |
putAll(java.util.Map<?,?> vals) |
void |
removeKey(ConfigKey<?> key) |
void |
removeKey(java.lang.String key) |
java.lang.Object |
setConfig(ConfigKey<?> key,
java.lang.Object v) |
void |
setLocalConfig(java.util.Map<ConfigKey<?>,?> vals) |
int |
size() |
java.lang.String |
toString() |
public TContainer getContainer()
public <T> T getConfig(ConfigKey<T> key)
public <T> T getConfig(ConfigKey.HasConfigKey<T> key)
public Maybe<java.lang.Object> getConfigLocalRaw(ConfigKey<?> key)
ConfigMap
getConfigLocalRaw
in interface ConfigMap
key
- key to look uppublic java.util.Map<ConfigKey<?>,java.lang.Object> getAllConfigLocalRaw()
ConfigMap
getAllConfigLocalRaw
in interface ConfigMap
@Deprecated public java.util.Map<ConfigKey<?>,java.lang.Object> getAllConfig()
getAllConfig
in interface ConfigMap
@Deprecated public ConfigBag getAllConfigBag()
public ConfigBag getLocalConfigBag()
#getLocalConfigRaw()
but in a ConfigBag
for conveniencepublic java.lang.Object setConfig(ConfigKey<?> key, java.lang.Object v)
public void setLocalConfig(java.util.Map<ConfigKey<?>,?> vals)
public void putAll(java.util.Map<?,?> vals)
public void removeKey(java.lang.String key)
public void removeKey(ConfigKey<?> key)
@Deprecated public Maybe<java.lang.Object> getConfigRaw(ConfigKey<?> key, boolean includeInherited)
ConfigMap
getConfigRaw
in interface ConfigMap
key
- key to look upincludeInherited
- for ConfigMap
instances which have an inheritance hierarchy,
whether to traverse it or not; has no effects where there is no inheritancepublic java.util.Map<java.lang.String,java.lang.Object> asMapWithStringKeys()
ConfigMap
asMapWithStringKeys
in interface ConfigMap
public <T> ReferenceWithError<ConfigValueAtContainer<TContainer,T>> getConfigAndContainer(ConfigKey<T> key)
ConfigMap.ConfigMapWithInheritance
getConfigAndContainer
in interface ConfigMap.ConfigMapWithInheritance<TContainer extends BrooklynObject>
public java.util.List<ConfigValueAtContainer<TContainer,?>> getConfigAllInheritedRaw(ConfigKey<?> queryKey)
ConfigMap.ConfigMapWithInheritance
ConfigMap.getConfigLocalRaw(ConfigKey)
but returning all containers through the inheritance
hierarchy where a value is set (but stopping if it encounters a key is not inheritable from a container).
The list is in order with the highest ancestor first. Config inheritance strategies are not applied, apart from aborting ancestor traversal if inheritance of a key is blocked there.
getConfigAllInheritedRaw
in interface ConfigMap.ConfigMapWithInheritance<TContainer extends BrooklynObject>
@Deprecated public java.util.Set<ConfigKey<?>> findKeys(<any> filter)
public java.util.Set<ConfigKey<?>> findKeysDeclared(<any> filter)
ConfigMap
#findKeysPresent(Predicate)
)findKeysDeclared
in interface ConfigMap
public java.util.Set<ConfigKey<?>> findKeysPresent(<any> filter)
ConfigMap
#findKeysDeclared(Predicate)
but restricted to keys actually present in the map
if there is a container or type context defining reference keys, those key definitions will be preferred over any config keys used as keys in this map.
findKeysPresent
in interface ConfigMap
public ReferenceWithError<ConfigValueAtContainer<TContainer,?>> getConfigInheritedRaw(ConfigKey<?> key)
ConfigMap.ConfigMapWithInheritance
ConfigMap.getConfigLocalRaw(ConfigKey)
but respecting the inheritance rules.
Because inheritance may not be applicable when working with raw values the result
is wrapped in a ReferenceWithError
, and if any aspect of inheritance
could not be applied, calls to ReferenceWithError.get()
will throw
(but ReferenceWithError.getWithoutError()
will not).
Default values will be available from ConfigValueAtContainer.getDefaultValue()
but will not be considered for ConfigValueAtContainer.get()
or ConfigValueAtContainer.asMaybe()
.
Note that most modes (eg overwrite, not-inherit) will not cause issues during inheritance so this method is ordinarily fine to use. Problems arise when a merge inheritance mode is specified and it is attempting to merge a raw value which is not mergeable.
See also ConfigMap.ConfigMapWithInheritance.getConfigAllInheritedRaw(ConfigKey)
which returns the complete set
of inherited values.
getConfigInheritedRaw
in interface ConfigMap.ConfigMapWithInheritance<TContainer extends BrooklynObject>
key
- key to look uppublic java.util.Map<ConfigKey<?>,java.lang.Object> getAllConfigInheritedRawValuesIgnoringErrors()
ConfigMap.ConfigMapWithInheritance
ConfigMap.ConfigMapWithInheritance.getAllConfigInheritedRawWithErrors()
but simplified API, just giving values, ignoring any errorsgetAllConfigInheritedRawValuesIgnoringErrors
in interface ConfigMap.ConfigMapWithInheritance<TContainer extends BrooklynObject>
public java.util.Map<ConfigKey<?>,ReferenceWithError<ConfigValueAtContainer<TContainer,?>>> getAllConfigInheritedRawWithErrors()
ConfigMap.ConfigMapWithInheritance
ConfigMap.ConfigMapWithInheritance.getConfigAllInheritedRaw(ConfigKey)
getAllConfigInheritedRawWithErrors
in interface ConfigMap.ConfigMapWithInheritance<TContainer extends BrooklynObject>
public java.util.Map<ConfigKey<?>,ReferenceWithError<ConfigValueAtContainer<TContainer,?>>> getAllReinheritableConfigRaw()
ConfigMap.ConfigMapWithInheritance
#getAllConfigInheritedRaw()
but removes any entries which should not be re-inheritable by descendantsgetAllReinheritableConfigRaw
in interface ConfigMap.ConfigMapWithInheritance<TContainer extends BrooklynObject>
public java.lang.String toString()
toString
in class java.lang.Object