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 atpathin its most specific type (i.e.getConfigSubsection(String path) <T> List<T> booleanisConfigSubsection(String path) <T> booleanMethods 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:AbstractConfigWrapperShould return the object atpathin its most specific type (i.e. as aStringor aList<Integer>not as anObject.)- Specified by:
getin classAbstractConfigWrapper- Parameters:
path-- Returns:
- the item at the specified path or null if path does not exist
-
getConfigSubsection
- Specified by:
getConfigSubsectionin interfaceConfigWrapper- Overrides:
getConfigSubsectionin classAbstractConfigWrapper
-
getList
- Specified by:
getListin interfaceConfigWrapper- Overrides:
getListin classAbstractConfigWrapper
-
isList
- Specified by:
isListin interfaceConfigWrapper- Overrides:
isListin classAbstractConfigWrapper
-
isConfigSubsection
- Specified by:
isConfigSubsectionin interfaceConfigWrapper- Overrides:
isConfigSubsectionin classAbstractConfigWrapper
-