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, trimToSize
equals, hashCode
containsAll, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
add, 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, toArray
parallelStream, removeIf, stream
protected 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 ISettingsList
public List<String> asStringSettingsList()
asStringSettingsList
in interface ISettingsList
public List<ISettingsMap> asSettingsMapList()
asSettingsMapList
in interface ISettingsList
protected String getChildName(int index)
public void setOriginatorName(String originatorName)
setOriginatorName
in interface ISettingsList
originatorName
- 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 ISettingsList
index
- the element indexpublic String getAsString(int index)
getAsString
in interface ISettingsList
index
- the element indexpublic Long getAsLong(int index)
getAsLong
in interface ISettingsList
index
- the element indexpublic Integer getAsInteger(int index)
getAsInteger
in interface ISettingsList
index
- the element indexpublic ISettingsList getAsSettingsList(int index)
ISettingsList
ISettingsList
.getAsSettingsList
in interface ISettingsList
index
- the element indexpublic ISettingsMap getAsSettingsMap(int index)
ISettingsList
ISettingsMap
.getAsSettingsMap
in interface ISettingsList
index
- 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 ISettingsList
public Map<String,Object> asFlatValuesMap(String indexedBy)
asFlatValuesMap
in interface ISettingsList
indexedBy
- a character that will be used as seperatorpublic String asJsonString()
asJsonString
in interface ISettingsList
public String asJsonString(IJsonSerializer s)
ISettingsList
asJsonString
in interface ISettingsList
s
- your serializerpublic static SettingsListImpl getNewInstance()
Copyright © 2014–2023. All rights reserved.