public interface Settings
of(Map[])| Modifier and Type | Interface and Description |
|---|---|
static interface |
Settings.SettingsBuilder
The Settings builder
Settings |
static interface |
Settings.SettingsBuilderProvider
A provider of
Settings.SettingsBuilder |
| Modifier and Type | Method and Description |
|---|---|
static Settings.SettingsBuilder |
builder()
Creates a
Settings.SettingsBuilder |
void |
computeIfAbsent(String key,
Function<String,Object> action)
If the specified key is not already associated with a value (or is mapped to null),
attempts to compute its value using the given mapping function and enters it into this map unless null.
|
void |
computeIfPresent(String key,
BiConsumer<String,Object> action)
If the value for the specified key is present and non-null, attempts to compute a new mapping given the key and its current mapped value.
|
boolean |
containsKey(String key)
Returns true if this map contains a mapping for the specified key.
|
Set<Map.Entry<String,Object>> |
entrySet()
Returns a Set view of the mappings contained in this map.
|
void |
forEach(BiConsumer<String,Object> action)
Performs the given action for each entry in this map until all entries have been processed or the action throws an exception.
|
Optional<Object> |
get(Collection<String> keys)
Returns the value to which the specified from one of these keys is mapped, or
Optional.empty()
if this map contains no mapping for the key. |
Optional<Object> |
get(String key)
Returns the value to which the specified key is mapped, or
Optional.empty() if this map contains no mapping for the key. |
<T> Optional<T> |
get(String key,
Class<T> type)
Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.
|
Object |
getOrDefault(String key,
Object defaultValue)
Returns the value to which the specified key is mapped, or defaultValue if this map contains no mapping for the key.
|
boolean |
isEmpty() |
Set<String> |
keySet()
Returns a Set view of the keys contained in this map.
|
static Settings |
of(Map<String,Object>... settings)
Creates a settings from maps
|
static Settings |
of(Map<String,Object> settings)
Creates a settings from maps
|
List<Object> |
prefix(Collection<String> prefixes)
Finds all keys that have the parameter as a prefix
|
List<Object> |
prefix(String prefix)
Finds all keys that have the parameter as a prefix
|
int |
size() |
Map<String,Object> |
toMap()
Converts the settings to
Map |
Set<String> keySet()
Optional<Object> get(String key)
Optional.empty() if this map contains no mapping for the key.key - the key whose associated value is to be returnedOptional.empty() if this map contains no mapping for the keyNullPointerException - when key is nullOptional<Object> get(Collection<String> keys)
Optional.empty()
if this map contains no mapping for the key.keys - the key whose associated value is to be returnedOptional.empty()
if this map contains no mapping for the keyNullPointerException - when keys is nullList<Object> prefix(String prefix)
prefix - the prefixNullPointerException - when prefix is nullList<Object> prefix(Collection<String> prefixes)
prefixes - the list of prefixesNullPointerException - when prefixes is null<T> Optional<T> get(String key, Class<T> type)
T - the type valuekey - the key whose associated value is to be returnedtype - the type be used as Value.get(Class)Optional.empty() if this map contains no mapping for the keyNullPointerException - when there are null parametersObject getOrDefault(String key, Object defaultValue)
key - the key whose associated value is to be returneddefaultValue - the default mapping of the keyboolean isEmpty()
int size()
boolean containsKey(String key)
key - key whose presence in this map is to be testedNullPointerException - when key is nullSet<Map.Entry<String,Object>> entrySet()
void forEach(BiConsumer<String,Object> action)
action - the actionNullPointerException - when action is nullvoid computeIfPresent(String key, BiConsumer<String,Object> action)
key - the keyaction - the actionNullPointerException - when there is null parametervoid computeIfAbsent(String key, Function<String,Object> action)
key - the keyaction - the actionNullPointerException - when there is null parameterstatic Settings.SettingsBuilder builder()
Settings.SettingsBuilderSettings.SettingsBuilder instancestatic Settings of(Map<String,Object> settings)
settings - the settingSettings instanceNullPointerException - when either the parameter is null or there key or value null@SafeVarargs static Settings of(Map<String,Object>... settings)
settings - the settingSettings instanceNullPointerException - when either the parameter is null or there key or value nullCopyright © 2017–2019 Eclipse Foundation. All rights reserved.