public class SettingsListImpl extends ArrayList<Object> implements ISettingsList
ISettingsList.| Modifier and Type | Field and Description |
|---|---|
protected String |
originatorName
This can be overridden by
NamedSettingsListImpl. |
modCount| Modifier | Constructor and Description |
|---|---|
protected |
SettingsListImpl()
Only used internally.
|
protected |
SettingsListImpl(List<Object> list,
String name)
Only used internally.
|
| Modifier and Type | Method and Description |
|---|---|
Map<String,Object> |
asFlatValuesMap() |
Map<String,Object> |
asFlatValuesMap(String indexedBy) |
String |
asJsonString() |
String |
asJsonString(IJsonSerializer s)
This variant accept a serializer to deal with unsupported types.
|
List<ISettingsMap> |
asSettingsMapList() |
List<String> |
asStringSettingsList() |
Boolean |
getAsBoolean(int index) |
Integer |
getAsInteger(int index) |
Long |
getAsLong(int index) |
ISettingsList |
getAsSettingsList(int index)
Return the ith element of a list, expecting it to be a
ISettingsList. |
ISettingsMap |
getAsSettingsMap(int index)
Return the ith element of a list, expecting it to be a
ISettingsMap. |
String |
getAsString(int index) |
protected String |
getChildName(int index) |
static SettingsListImpl |
getNewInstance() |
String |
getOriginatorName() |
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 ISettingsList |
newSettingsListChild(String name)
Returns a new instance of appropriate Settings list implementation for this settings tree
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
|
protected ISettingsMap |
newSettingsMapChild(String name)
Returns a new instance of appropriate Settings map implementation for this settings tree
The returned object has not been added to the THIS settings map
|
void |
setOriginatorName(String originatorName) |
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSizeequals, hashCodecontainsAll, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitadd, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArrayparallelStream, removeIf, streamprotected String originatorName
NamedSettingsListImpl.protected SettingsListImpl(List<Object> list, String name)
list - The settings list to shallow copyname - The name context to tag all logs/exceptions concerning properties of this mapprotected SettingsListImpl()
public String getOriginatorName()
getOriginatorName in interface ISettingsListpublic List<String> asStringSettingsList()
asStringSettingsList in interface ISettingsListpublic List<ISettingsMap> asSettingsMapList()
asSettingsMapList in interface ISettingsListprotected String getChildName(int index)
public void setOriginatorName(String originatorName)
setOriginatorName in interface ISettingsListoriginatorName - that should be used to identify naming context in exception/log strings
by default, name is class name.public Boolean getAsBoolean(int index)
getAsBoolean in interface ISettingsListindex - the element indexpublic String getAsString(int index)
getAsString in interface ISettingsListindex - the element indexpublic Long getAsLong(int index)
getAsLong in interface ISettingsListindex - the element indexpublic Integer getAsInteger(int index)
getAsInteger in interface ISettingsListindex - the element indexpublic ISettingsList getAsSettingsList(int index)
ISettingsListISettingsList.getAsSettingsList in interface ISettingsListindex - the element indexpublic ISettingsMap getAsSettingsMap(int index)
ISettingsListISettingsMap.getAsSettingsMap in interface ISettingsListindex - the element indexprotected ISettingsMap newSettingsMapChild(Map<String,Object> map, String name)
map - an Objects map containing settings, used to initialize the new settings mapname - a nameprotected ISettingsList newSettingsListChild(List<Object> list, String name)
list - a listname - a nameprotected ISettingsMap newSettingsMapChild(String name)
name - a nameprotected ISettingsList newSettingsListChild(String name)
name - a namepublic Map<String,Object> asFlatValuesMap()
asFlatValuesMap in interface ISettingsListpublic Map<String,Object> asFlatValuesMap(String indexedBy)
asFlatValuesMap in interface ISettingsListindexedBy - a character that will be used as seperatorpublic String asJsonString()
asJsonString in interface ISettingsListpublic String asJsonString(IJsonSerializer s)
ISettingsListasJsonString in interface ISettingsLists - your serializerpublic static SettingsListImpl getNewInstance()
Copyright © 2014–2022. All rights reserved.