public interface BrooklynProperties extends StringConfigMap
getFirst(Map, String...)
Intention for normal use is that they are set during startup and not modified thereafter.
Modifier and Type | Interface and Description |
---|---|
static class |
BrooklynProperties.Factory |
ConfigMap.ConfigMapWithInheritance<TContainer>
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
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) |
java.lang.String |
get(java.util.Map flags,
java.lang.String key)
Deprecated.
attempts to call get with this syntax are probably mistakes; get(key, defaultValue) is fine but
Map is unlikely the key, much more likely they meant getFirst(flags, key).
|
java.util.Map<ConfigKey<?>,java.lang.Object> |
getAllConfig()
Deprecated.
|
<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> |
getConfigRaw(ConfigKey<?> key) |
Maybe<java.lang.Object> |
getConfigRaw(ConfigKey<?> key,
boolean includeInherited)
Deprecated.
since 0.10.0 the second parameter is ignored for
BrooklynProperties ; use ConfigMap.getConfigLocalRaw(ConfigKey) . |
java.lang.String |
getFirst(java.util.Map flags,
java.lang.String... keys)
returns the value of the first key which is defined
|
java.lang.String |
getFirst(java.lang.String... keys)
returns the value of the first key which is defined
|
<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) |
BrooklynProperties |
submap(<any> filter)
returns submap matching the given filter predicate; see ConfigPredicates for common predicates
|
BrooklynProperties |
submapByName(<any> filter) |
findKeys, findKeysDeclared, findKeysPresent, getAllConfigLocalRaw, getConfigLocalRaw, isEmpty, size
BrooklynProperties addEnvironmentVars()
BrooklynProperties addSystemProperties()
BrooklynProperties addFrom(ConfigBag cfg)
BrooklynProperties addFrom(java.util.Map map)
BrooklynProperties addFrom(java.io.InputStream i)
BrooklynProperties addFrom(java.io.File f)
BrooklynProperties addFrom(java.net.URL u)
BrooklynProperties addFromUrl(java.lang.String url)
BrooklynProperties addFromUrlProperty(java.lang.String urlProperty)
addFromUrl(String)
;
if property not set, does nothingBrooklynProperties addFromMap(java.util.Map properties)
boolean putIfAbsent(java.lang.String key, java.lang.Object value)
@Deprecated java.lang.String get(java.util.Map flags, java.lang.String key)
java.lang.String getFirst(java.lang.String... keys)
takes the following flags: 'warnIfNone', 'failIfNone' (both taking a boolean (to use default message) or a string (which is the message)); and 'defaultIfNone' (a default value to return if there is no such property); defaults to no warning and null response
getFirst
in interface StringConfigMap
StringConfigMap.getFirst(java.util.Map, String...)
java.lang.String getFirst(java.util.Map flags, java.lang.String... keys)
StringConfigMap
takes the following flags: 'warnIfNone' or 'failIfNone' (both taking a boolean (to use default message) or a string (which is the message)); and 'defaultIfNone' (a default value to return if there is no such property); defaults to no warning and null default value
getFirst
in interface StringConfigMap
java.lang.Object put(java.lang.Object key, java.lang.Object value)
void putAll(java.util.Map vals)
Map.putAll(Map)
, except config keys are dereferenced on the way in<T> java.lang.Object put(ConfigKey.HasConfigKey<T> key, T value)
<T> java.lang.Object put(ConfigKey<T> key, T value)
<T> boolean putIfAbsent(ConfigKey<T> key, T value)
boolean containsKey(java.lang.String key)
boolean containsKey(ConfigKey<?> key)
boolean remove(java.lang.String key)
boolean remove(ConfigKey<?> key)
java.lang.Object getConfig(java.lang.String key)
<T> T getConfig(ConfigKey<T> key)
<T> T getConfig(ConfigKey.HasConfigKey<T> key)
<T> T getConfig(ConfigKey.HasConfigKey<T> key, T defaultValue)
<T> T getConfig(ConfigKey<T> key, T defaultValue)
@Deprecated Maybe<java.lang.Object> getConfigRaw(ConfigKey<?> key, boolean includeInherited)
BrooklynProperties
; use ConfigMap.getConfigLocalRaw(ConfigKey)
.getConfigRaw(ConfigKey)
.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 inheritance@Deprecated java.util.Map<ConfigKey<?>,java.lang.Object> getAllConfig()
ConfigMap
getAllConfig
in interface ConfigMap
BrooklynProperties submap(<any> filter)
StringConfigMap
submap
in interface ConfigMap
submap
in interface StringConfigMap
BrooklynProperties submapByName(<any> filter)
java.util.Map<java.lang.String,java.lang.Object> asMapWithStringKeys()
StringConfigMap
asMapWithStringKeys
in interface ConfigMap
asMapWithStringKeys
in interface StringConfigMap