public class ConfigSection extends LinkedHashMap<String,Object>
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| Constructor and Description |
|---|
ConfigSection()
Empty ConfigSection constructor
|
ConfigSection(LinkedHashMap<String,Object> map)
Constructor of ConfigSection, based on values stored in map.
|
ConfigSection(String key,
Object value)
Constructor of ConfigSection that contains initial key/value data
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
exists(String key)
Check existence of config section element
|
boolean |
exists(String key,
boolean ignoreCase)
Check existence of config section element
|
Object |
get(String key)
Get object by key.
|
<T> T |
get(String key,
T defaultValue)
Get object by key.
|
ConfigSection |
getAll()
Get new instance of config section
|
Map<String,Object> |
getAllMap()
Get root section as LinkedHashMap
|
boolean |
getBoolean(String key)
Get boolean value of config section element
|
boolean |
getBoolean(String key,
boolean defaultValue)
Get boolean value of config section element
|
List<Boolean> |
getBooleanList(String key)
Get Boolean List value of config section element
|
List<Byte> |
getByteList(String key)
Get Byte List value of config section element
|
List<Character> |
getCharacterList(String key)
Get Character List value of config section element
|
double |
getDouble(String key)
Get double value of config section element
|
double |
getDouble(String key,
double defaultValue)
Get double value of config section element
|
List<Double> |
getDoubleList(String key)
Get Double List value of config section element
|
List<Float> |
getFloatList(String key)
Get Float List value of config section element
|
int |
getInt(String key)
Get int value of config section element
|
int |
getInt(String key,
int defaultValue)
Get int value of config section element
|
List<Integer> |
getIntegerList(String key)
Get Integer List value of config section element
|
Set<String> |
getKeys()
Get all keys
|
Set<String> |
getKeys(boolean child)
Get all keys
|
<T> List<T> |
getList(String key)
Get List value of config section element
|
<T> List<T> |
getList(String key,
List<T> defaultList)
Get List value of config section element
|
long |
getLong(String key)
Get long value of config section element
|
long |
getLong(String key,
long defaultValue)
Get long value of config section element
|
List<Long> |
getLongList(String key)
Get Long List value of config section element
|
List<Map> |
getMapList(String key)
Get Map List value of config section element
|
ConfigSection |
getSection(String key)
Get config section element defined by key
|
ConfigSection |
getSections()
Get all ConfigSections in root path.
|
ConfigSection |
getSections(String key)
Get sections (and only sections) from provided path
|
List<Short> |
getShortList(String key)
Get Short List value of config section element
|
String |
getString(String key)
Get String value of config section element
|
String |
getString(String key,
String defaultValue)
Get String value of config section element
|
List<String> |
getStringList(String key)
Get String List value of config section element
|
boolean |
isBoolean(String key)
Check type of section element defined by key.
|
boolean |
isDouble(String key)
Check type of section element defined by key.
|
boolean |
isInt(String key)
Check type of section element defined by key.
|
boolean |
isList(String key)
Check type of section element defined by key.
|
boolean |
isLong(String key)
Check type of section element defined by key.
|
boolean |
isSection(String key)
Check type of section element defined by key.
|
boolean |
isString(String key)
Check type of section element defined by key.
|
void |
remove(String key)
Remove config section element
|
void |
set(String key,
Object value)
Store value into config section
|
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, removeEldestEntry, replaceAll, valuesclone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, sizeequals, hashCode, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitcompute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, sizepublic ConfigSection()
public ConfigSection(String key, Object value)
key - value - public ConfigSection(LinkedHashMap<String,Object> map)
map - public ConfigSection getAll()
public <T> T get(String key, T defaultValue)
key - defaultValue - public void set(String key, Object value)
key - value - public boolean isSection(String key)
key - public ConfigSection getSection(String key)
key - public ConfigSection getSections()
getSections() will return new ConfigSection, that contains sections a1 and a2 only.
public ConfigSection getSections(String key)
key - - config section path, if null or empty root path will used.public int getInt(String key)
key - - key (inside) current section (default value equals to 0)public int getInt(String key, int defaultValue)
key - - key (inside) current sectiondefaultValue - - default value that will returned if section element is not existspublic boolean isInt(String key)
key - public long getLong(String key)
key - - key (inside) current sectionpublic long getLong(String key, long defaultValue)
key - - key (inside) current sectiondefaultValue - - default value that will returned if section element is not existspublic boolean isLong(String key)
key - public double getDouble(String key)
key - - key (inside) current sectionpublic double getDouble(String key, double defaultValue)
key - - key (inside) current sectiondefaultValue - - default value that will returned if section element is not existspublic boolean isDouble(String key)
key - public String getString(String key)
key - - key (inside) current sectionpublic String getString(String key, String defaultValue)
key - - key (inside) current sectiondefaultValue - - default value that will returned if section element is not existspublic boolean isString(String key)
key - public boolean getBoolean(String key)
key - - key (inside) current sectionpublic boolean getBoolean(String key, boolean defaultValue)
key - - key (inside) current sectiondefaultValue - - default value that will returned if section element is not existspublic boolean isBoolean(String key)
key - public <T> List<T> getList(String key)
key - - key (inside) current sectionpublic <T> List<T> getList(String key, List<T> defaultList)
key - - key (inside) current sectiondefaultList - - default value that will returned if section element is not existspublic boolean isList(String key)
key - public List<String> getStringList(String key)
key - - key (inside) current sectionpublic List<Integer> getIntegerList(String key)
key - - key (inside) current sectionpublic List<Boolean> getBooleanList(String key)
key - - key (inside) current sectionpublic List<Double> getDoubleList(String key)
key - - key (inside) current sectionpublic List<Float> getFloatList(String key)
key - - key (inside) current sectionpublic List<Long> getLongList(String key)
key - - key (inside) current sectionpublic List<Byte> getByteList(String key)
key - - key (inside) current sectionpublic List<Character> getCharacterList(String key)
key - - key (inside) current sectionpublic List<Short> getShortList(String key)
key - - key (inside) current sectionpublic List<Map> getMapList(String key)
key - - key (inside) current sectionpublic boolean exists(String key, boolean ignoreCase)
key - ignoreCase - public boolean exists(String key)
key - public void remove(String key)
key - public Set<String> getKeys(boolean child)
child - - true = include child keysCopyright © 2020. All rights reserved.