public class DeferredBrooklynProperties extends java.lang.Object implements BrooklynProperties
BrooklynProperties
implementation, but intercepts all calls to get.
The results are transformed: if they are in the external-config format then they are
automatically converted to DeferredSupplier
.
The external-config format is that same as that for camp-yaml blueprints (i.e.
$brooklyn:external("myprovider", "mykey")
.BrooklynProperties.Factory
ConfigMap.ConfigMapWithInheritance<TContainer>
Constructor and Description |
---|
DeferredBrooklynProperties(BrooklynProperties delegate,
ManagementContextInternal mgmt) |
Modifier and Type | Method and Description |
---|---|
BrooklynProperties |
addEnvironmentVars() |
BrooklynProperties |
addFrom(ConfigBag cfg) |
BrooklynProperties |
addFrom(java.io.File f) |
BrooklynProperties |
addFrom(java.io.InputStream i) |
BrooklynProperties |
addFrom(java.util.Map map) |
BrooklynProperties |
addFrom(java.net.URL u) |
BrooklynProperties |
addFromMap(java.util.Map properties)
adds the indicated properties
|
BrooklynProperties |
addFromUrl(java.lang.String url) |
BrooklynProperties |
addFromUrlProperty(java.lang.String urlProperty)
expects a property already set in scope, whose value is acceptable to
BrooklynProperties.addFromUrl(String) ;
if property not set, does nothing |
BrooklynProperties |
addSystemProperties() |
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
|
boolean |
containsKey(ConfigKey<?> key) |
boolean |
containsKey(java.lang.String key) |
boolean |
equals(java.lang.Object o) |
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.lang.String |
get(java.util.Map flags,
java.lang.String key)
Deprecated.
|
java.util.Map<ConfigKey<?>,java.lang.Object> |
getAllConfig()
Deprecated.
|
java.util.Map<ConfigKey<?>,java.lang.Object> |
getAllConfigLocalRaw()
returns a read-only map of all local config keys with their raw (unresolved+uncoerced) contents
|
<T> T |
getConfig(ConfigKey.HasConfigKey<T> key) |
<T> T |
getConfig(ConfigKey.HasConfigKey<T> key,
T defaultValue) |
<T> T |
getConfig(ConfigKey<T> key) |
<T> T |
getConfig(ConfigKey<T> key,
T defaultValue)
Returns value stored against the given key,
resolved (if it is a Task, possibly blocking), and coerced to the appropriate type,
or given default value if not set,
unless the default value is null in which case it returns the default.
|
java.lang.Object |
getConfig(java.lang.String key) |
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) |
Maybe<java.lang.Object> |
getConfigRaw(ConfigKey<?> key,
boolean includeInherited)
Deprecated.
|
java.lang.String |
getFirst(java.util.Map flags,
java.lang.String... keys)
Discouraged; returns the String so if it is external config, it will be the
$brooklyn:external(...) format. |
java.lang.String |
getFirst(java.lang.String... keys)
Discouraged; returns the String so if it is external config, it will be the
$brooklyn:external(...) format. |
int |
hashCode() |
boolean |
isEmpty() |
<T> java.lang.Object |
put(ConfigKey.HasConfigKey<T> key,
T value) |
<T> java.lang.Object |
put(ConfigKey<T> key,
T value) |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
like normal map.put, except config keys are dereferenced on the way in
|
void |
putAll(java.util.Map vals)
like normal
Map.putAll(Map) , except config keys are dereferenced on the way in |
<T> boolean |
putIfAbsent(ConfigKey<T> key,
T value) |
boolean |
putIfAbsent(java.lang.String key,
java.lang.Object value)
inserts the value under the given key, if it was not present
|
boolean |
remove(ConfigKey<?> key) |
boolean |
remove(java.lang.String key) |
int |
size() |
BrooklynProperties |
submap(<any> filter)
returns submap matching the given filter predicate; see ConfigPredicates for common predicates
|
BrooklynProperties |
submapByName(<any> filter) |
java.lang.String |
toString() |
public DeferredBrooklynProperties(BrooklynProperties delegate, ManagementContextInternal mgmt)
public boolean containsKey(java.lang.String key)
containsKey
in interface BrooklynProperties
public boolean containsKey(ConfigKey<?> key)
containsKey
in interface BrooklynProperties
public boolean remove(java.lang.String key)
remove
in interface BrooklynProperties
public boolean remove(ConfigKey<?> key)
remove
in interface BrooklynProperties
public java.lang.Object getConfig(java.lang.String key)
getConfig
in interface BrooklynProperties
public <T> T getConfig(ConfigKey<T> key)
getConfig
in interface ConfigMap
getConfig
in interface BrooklynProperties
#getConfig(ConfigKey, Object), with default value as per the key, or null
public <T> T getConfig(ConfigKey.HasConfigKey<T> key)
getConfig
in interface ConfigMap
getConfig
in interface BrooklynProperties
#getConfig(ConfigKey, Object), with default value as per the key, or null
public <T> T getConfig(ConfigKey.HasConfigKey<T> key, T defaultValue)
getConfig
in interface BrooklynProperties
public <T> T getConfig(ConfigKey<T> key, T defaultValue)
BrooklynProperties
getConfig
in interface BrooklynProperties
public Maybe<java.lang.Object> getConfigRaw(ConfigKey<?> key)
getConfigRaw
in interface BrooklynProperties
@Deprecated public Maybe<java.lang.Object> getConfigRaw(ConfigKey<?> key, boolean includeInherited)
BrooklynProperties
BrooklynProperties.getConfigRaw(ConfigKey)
.getConfigRaw
in interface ConfigMap
getConfigRaw
in interface BrooklynProperties
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 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()
ConfigMap
getAllConfig
in interface ConfigMap
getAllConfig
in interface BrooklynProperties
public java.util.Map<java.lang.String,java.lang.Object> asMapWithStringKeys()
StringConfigMap
asMapWithStringKeys
in interface ConfigMap
asMapWithStringKeys
in interface StringConfigMap
asMapWithStringKeys
in interface BrooklynProperties
@Deprecated public java.lang.String get(java.util.Map flags, java.lang.String key)
$brooklyn:external(...)
format.get
in interface BrooklynProperties
public java.lang.String getFirst(java.lang.String... keys)
$brooklyn:external(...)
format.getFirst
in interface StringConfigMap
getFirst
in interface BrooklynProperties
StringConfigMap.getFirst(java.util.Map, String...)
public java.lang.String getFirst(java.util.Map flags, java.lang.String... keys)
$brooklyn:external(...)
format.getFirst
in interface StringConfigMap
getFirst
in interface BrooklynProperties
public BrooklynProperties submap(<any> filter)
StringConfigMap
submap
in interface ConfigMap
submap
in interface StringConfigMap
submap
in interface BrooklynProperties
public BrooklynProperties submapByName(<any> filter)
submapByName
in interface BrooklynProperties
@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 BrooklynProperties addEnvironmentVars()
addEnvironmentVars
in interface BrooklynProperties
public BrooklynProperties addSystemProperties()
addSystemProperties
in interface BrooklynProperties
public BrooklynProperties addFrom(ConfigBag cfg)
addFrom
in interface BrooklynProperties
public BrooklynProperties addFrom(java.util.Map map)
addFrom
in interface BrooklynProperties
public BrooklynProperties addFrom(java.io.InputStream i)
addFrom
in interface BrooklynProperties
public BrooklynProperties addFrom(java.io.File f)
addFrom
in interface BrooklynProperties
public BrooklynProperties addFrom(java.net.URL u)
addFrom
in interface BrooklynProperties
public BrooklynProperties addFromUrl(java.lang.String url)
public BrooklynProperties addFromUrlProperty(java.lang.String urlProperty)
BrooklynProperties
BrooklynProperties.addFromUrl(String)
;
if property not set, does nothingaddFromUrlProperty
in interface BrooklynProperties
public BrooklynProperties addFromMap(java.util.Map properties)
BrooklynProperties
addFromMap
in interface BrooklynProperties
public boolean putIfAbsent(java.lang.String key, java.lang.Object value)
BrooklynProperties
putIfAbsent
in interface BrooklynProperties
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Object put(java.lang.Object key, java.lang.Object value)
BrooklynProperties
put
in interface BrooklynProperties
public void putAll(java.util.Map vals)
BrooklynProperties
Map.putAll(Map)
, except config keys are dereferenced on the way inputAll
in interface BrooklynProperties
public <T> java.lang.Object put(ConfigKey.HasConfigKey<T> key, T value)
put
in interface BrooklynProperties
public <T> java.lang.Object put(ConfigKey<T> key, T value)
put
in interface BrooklynProperties
public <T> boolean putIfAbsent(ConfigKey<T> key, T value)
putIfAbsent
in interface BrooklynProperties
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object