Class MapConfigWrapper
java.lang.Object
io.github.ttno1.configvalidation.defaultwrappers.AbstractConfigWrapper
io.github.ttno1.configvalidation.defaultwrappers.MapConfigWrapper
- All Implemented Interfaces:
ConfigWrapper
- Direct Known Subclasses:
SnakeYamlConfigWrapper
A ConfigWrapper that gets its values from a map of strings to objects.
This class assumes that all config subsections are contained within the main map as sub-maps.
This class assumes that all config subsections are contained within the main map as sub-maps.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionShould return the object atpath
in its most specific type (i.e.getConfigSubsection
(String path) <T> List
<T> boolean
isConfigSubsection
(String path) <T> boolean
Methods inherited from class io.github.ttno1.configvalidation.defaultwrappers.AbstractConfigWrapper
containsNode, getBoolean, getByte, getDouble, getFloat, getInteger, getLong, getShort, getString, isBoolean, isByte, isDouble, isFloat, isInteger, isLong, isShort, isString
-
Constructor Details
-
MapConfigWrapper
- Parameters:
map
-separator
- the regex expression that separates nodes from sub-nodes e.g. "\."- Throws:
NullPointerException
- if map is nullIllegalArgumentException
- if separator is null or empty
-
-
Method Details
-
get
Description copied from class:AbstractConfigWrapper
Should return the object atpath
in its most specific type (i.e. as aString
or aList<Integer>
not as anObject
.)- Specified by:
get
in classAbstractConfigWrapper
- Parameters:
path
-- Returns:
- the item at the specified path or null if path does not exist
-
getConfigSubsection
- Specified by:
getConfigSubsection
in interfaceConfigWrapper
- Overrides:
getConfigSubsection
in classAbstractConfigWrapper
-
getList
- Specified by:
getList
in interfaceConfigWrapper
- Overrides:
getList
in classAbstractConfigWrapper
-
isList
- Specified by:
isList
in interfaceConfigWrapper
- Overrides:
isList
in classAbstractConfigWrapper
-
isConfigSubsection
- Specified by:
isConfigSubsection
in interfaceConfigWrapper
- Overrides:
isConfigSubsection
in classAbstractConfigWrapper
-