public class NamedSettingsMapImpl extends SettingsMapImpl
This is useful to provide feedback to a final user on the location of a missing/invalid parameter not as HashMap : the constructor taking a map as parameter works by deep copy (internal sub-settings objects are NOT shared with the original).
This is required in order to provide separate naming context for errors
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
originatorName
Constructor and Description |
---|
NamedSettingsMapImpl(Map<String,Object> map,
String name)
Does Deep copy of settings, to avoid changing the naming of a setting
already including in an other settings tree
|
NamedSettingsMapImpl(String originatorName)
Public Ctor
|
Modifier and Type | Method and Description |
---|---|
protected ISettingsList |
newSettingsListChild(List<Object> list,
String name)
Returns a new instance of appropriate Settings list implementation for this settings tree
Initialized with same content as a provided list containing
The returned object has not been added to the THIS settings map
|
protected ISettingsMap |
newSettingsMapChild(Map<String,Object> map,
String name)
Returns a new instance of appropriate Settings map implementation for this settings tree
Initialized with same content as a provided map containing
The returned object has not been added to the THIS settings map
|
Object |
put(String key,
Object object) |
void |
putAll(Map<? extends String,? extends Object> map) |
Object |
putWithNoCloning(String key,
Object object)
Put the object as reference.
|
ISettingsMap |
setOriginatorName(String name)
SettingsMap can be associated with a name referencing the original
file (typically0.
|
asFlatValuesMap, asFlatValuesMap, asFlatValuesMapIgnoreSettingsList, asHjsonString, asJsonString, asJsonString, asKvString, asListFlatValuesMapIgnoreSettingsList, asYamlString, childAsJson, childAsRawContent, childAsTarGz, childFileAsMap, childIsDir, childIsFile, getAsBoolean, getAsBoolean, getAsDouble, getAsInteger, getAsInteger, getAsIsoDateTime, getAsLong, getAsLong, getAsMsDuration, getAsRequiredBoolean, getAsRequiredDouble, getAsRequiredInteger, getAsRequiredIsoDateTime, getAsRequiredLong, getAsRequiredObject, getAsRequiredObjectOfClass, getAsRequiredSettingsList, getAsRequiredSettingsMap, getAsRequiredString, getAsRequiredTimeValue, getAsRequiredZonedDateTime, getAsSettingsList, getAsSettingsList, getAsSettingsListOrEmpty, getAsSettingsMap, getAsSettingsMap, getAsString, getAsString, getAsTimeValue, getChildName, getCreateMap, getDeepCopy, getMapOrEmpty, getNestedProperty, getNewInstance, getOrCreateNestedSettingsMap, getOriginatorName, getRequiredNestedProperty, getStringOrFail, getStringOrFail, getTimeValueMs, newSettingsMapChild, overrideWith, putUsingDottedPath, putUsingSlashPath, removeUsingDottedPath, removeUsingSlashPath, setJsonDecoding, setNestedProperty, setPropertyIfMissing
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
equals, hashCode, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
childAsListOfString, childAsMapEntries, childAsMapValues, childAsRequiredListOfString, childAsRequiredString, childAsString, childAsStringContent, getCreateAsListOfMap
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
public NamedSettingsMapImpl(String originatorName)
originatorName
- the (typically file) name associated to this settings mappublic NamedSettingsMapImpl(Map<String,Object> map, String name)
map
- The settings map to deep copyname
- The name context to tag all logs/exceptions concerning
properties of this mapprotected ISettingsMap newSettingsMapChild(Map<String,Object> map, String name)
SettingsMapImpl
newSettingsMapChild
in class SettingsMapImpl
map
- an Objects map containing settings, used to initialize the new settings mapname
- a nameprotected ISettingsList newSettingsListChild(List<Object> list, String name)
SettingsMapImpl
newSettingsListChild
in class SettingsMapImpl
list
- a list of of type objectname
- a namepublic ISettingsMap setOriginatorName(String name)
ISettingsMap
setOriginatorName
in interface ISettingsMap
setOriginatorName
in class SettingsMapImpl
name
- the name to associatepublic Object putWithNoCloning(String key, Object object)
key
- the property keyobject
- the valueCopyright © 2014–2023. All rights reserved.