Package org.refcodes.structure
Interface CanonicalMap
-
- All Superinterfaces:
Containable
,org.refcodes.mixin.DelimiterAccessor
,Dictionary<java.lang.String,T>
,org.refcodes.mixin.Dumpable
,Keys<java.lang.String,T>
,PathMap<java.lang.String>
,PropertiesAccessorMixin
,org.refcodes.mixin.TypeAccessor<java.lang.String>
- All Known Subinterfaces:
CanonicalMap.CanonicalMapBuilder
,CanonicalMap.MutableCanonicalMap
- All Known Implementing Classes:
CanonicalMapBuilderImpl
,CanonicalMapImpl
public interface CanonicalMap extends PathMap<java.lang.String>, PropertiesAccessorMixin
TheCanonicalMap
is an "intermediate" type adding type and Data-Structure related functionality to any implementing class.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
CanonicalMap.CanonicalMapBuilder
The Interface CanonicalMapBuilder.static interface
CanonicalMap.MutableCanonicalMap
The Interface MutableCanonicalMap.-
Nested classes/interfaces inherited from interface org.refcodes.mixin.DelimiterAccessor
org.refcodes.mixin.DelimiterAccessor.DelimiterBuilder<B extends org.refcodes.mixin.DelimiterAccessor.DelimiterBuilder<B>>, org.refcodes.mixin.DelimiterAccessor.DelimiterMutator, org.refcodes.mixin.DelimiterAccessor.DelimiterProperty
-
Nested classes/interfaces inherited from interface org.refcodes.structure.Dictionary
Dictionary.MutableDictionary<K,V>
-
Nested classes/interfaces inherited from interface org.refcodes.structure.Keys
Keys.MutableKeys<K,V>, Keys.MutableValues<K,V>
-
Nested classes/interfaces inherited from interface org.refcodes.structure.PathMap
PathMap.MutablePathMap<T>, PathMap.PathMapBuilder<T>
-
Nested classes/interfaces inherited from interface org.refcodes.structure.PropertiesAccessorMixin
PropertiesAccessorMixin.PropertiesBuilderMixin<T>, PropertiesAccessorMixin.PropertiesMixin, PropertiesAccessorMixin.PropertiesMutatorMixin
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_COMMENT
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default boolean
containsValue(java.lang.Object value)
This method is defined for the sake ofMap
conformity.default java.lang.Boolean
getBoolean(java.lang.Object... aPathElements)
Returns theBoolean
value of the property referred to by the path elements.default java.lang.Boolean
getBoolean(java.lang.String... aPathElements)
Returns theBoolean
value of the property referred to by the path elements.default java.lang.Byte
getByte(java.lang.Object... aPathElements)
Returns theByte
value of the property referred to by the path elements.default java.lang.Byte
getByte(java.lang.String... aPathElements)
Returns theByte
value of the property referred to by the path elements.default java.lang.Character
getCharacter(java.lang.Object... aPathElements)
Returns theCharacter
value of the property referred to by the path elements.default java.lang.Character
getCharacter(java.lang.String... aPathElements)
Returns theCharacter
value of the property referred to by the key.default CanonicalMap
getDirAt(int aIndex)
An indexed directory represents all elements which begin with a path which's last path element represents an index.default CanonicalMap
getDirAt(java.lang.String aPath, int aIndex)
An indexed directory represents all elements which begin with a path which's last path element represents an index.default java.lang.Double
getDouble(java.lang.Object... aPathElements)
Returns theDouble
value of the property referred to by the path elements.default java.lang.Double
getDouble(java.lang.String... aPathElements)
Returns theDouble
value of the property referred to by the path elements.default java.lang.Float
getFloat(java.lang.Object... aPathElements)
Returns theFloat
value of the property referred to by the path elements.default java.lang.Float
getFloat(java.lang.String... aPathElements)
Returns theFloat
value of the property referred to by the path elements.default java.lang.Integer
getInteger(java.lang.Object... aPathElements)
Returns theInteger
value of the property referred to by the path elements.default java.lang.Integer
getInteger(java.lang.String... aPathElements)
Returns theInteger
value of the property referred to by the path elements.default java.lang.Long
getLong(java.lang.Object... aPathElements)
Returns theLong
value of the property referred to by the path elements.default java.lang.Long
getLong(java.lang.String... aPathElements)
Returns theLong
value of the property referred to by the path elements.default java.lang.Short
getShort(java.lang.Object... aPathElements)
Returns theShort
value of the property referred to by the path elements.default java.lang.Short
getShort(java.lang.String... aPathElements)
Returns theShort
value of the property referred to by the path elements.default CanonicalMap
query(java.lang.String aPathQuery)
Queries the keys of the instance using thePathMatcher
' matching patterns, similar to the wildcards '*', '?'default CanonicalMap
query(java.lang.String aPathQuery, java.lang.String aFromPath, java.lang.String aToPath)
Queries the keys of the instance using thePathMatcher
' matching patterns, similar to the wildcards '*', '?'default CanonicalMap
queryFrom(java.lang.String aPathQuery, java.lang.String aFromPath)
Queries the keys of the instance using thePathMatcher
' matching patterns, similar to the wildcards '*', '?'default CanonicalMap
queryTo(java.lang.String aPathQuery, java.lang.String aToPath)
Queries the keys of the instance using thePathMatcher
' matching patterns, similar to the wildcards '*', '?'default CanonicalMap
retrieve(java.lang.String aFromPath, java.lang.String aToPath)
default CanonicalMap
retrieveFrom(java.lang.Object aParentPath)
Gets the children elements of the provided parent's path, excluding the parent's path.default CanonicalMap
retrieveFrom(java.lang.Object... aPathElements)
Gets the children elements of the provided parent's path elements, excluding the parent's path.CanonicalMap
retrieveFrom(java.lang.String aFromPath)
default CanonicalMap
retrieveTo(java.lang.Object aToPath)
default CanonicalMap
retrieveTo(java.lang.Object... aToPathElements)
CanonicalMap
retrieveTo(java.lang.String aToPath)
default CanonicalMap
retrieveTo(java.lang.String... aToPathElements)
default <T> void
toInstance(java.lang.String aFromPath, T aInstance)
Updates the instance with thisCanonicalMap
's data.default <T> void
toInstance(T aInstance)
Updates the instance with thisCanonicalMap
's data.default <T> T
toType(java.lang.Class<T> aType)
Creates an instance of the given type filled with thisCanonicalMap
's data.default <T> T
toType(java.lang.String aFromPath, java.lang.Class<T> aType)
Creates an instance of the given type filled with thisCanonicalMap
's data.-
Methods inherited from interface org.refcodes.structure.Containable
isEmpty, size
-
Methods inherited from interface org.refcodes.structure.PathMap
children, children, children, children, children, containsKey, containsKey, dirs, dirs, dirs, dirs, dirs, fromExternalPath, get, get, getArray, getArray, getArray, getArray, getArrayIndexes, getArrayIndexes, getArrayIndexes, getArrayIndexes, getDirAt, getDirAt, getDirAt, getDirIndexes, getDirIndexes, getDirIndexes, getDirIndexes, getRootPath, getValueAt, getValueAt, getValueAt, getValueAt, getValueAt, hasChildren, hasChildren, hasChildren, hasChildren, hasDirAt, hasDirAt, hasDirAt, hasDirAt, hasDirAt, hasDirAt, hasDirAt, hasDirAt, hasDirAt, hasParentPath, hasPath, hasPath, hasPath, hasValueAt, hasValueAt, hasValueAt, hasValueAt, isArray, isArray, isArray, isArray, isArray, isArrayIndex, isArrayIndex, isArrayIndex, isArrayIndex, isArrayIndex, isChild, isChild, isChild, isDir, isDir, isDir, isDir, isDirIndex, isDirIndex, isDirIndex, isDirIndex, isLeaf, isLeaf, isLeaf, isLeaf, isRootPath, keySet, lastArrayIndex, lastArrayIndex, lastArrayIndex, lastArrayIndex, lastArrayIndex, lastDirIndex, lastDirIndex, lastDirIndex, lastDirIndex, lastDirIndex, leaves, leaves, leaves, leaves, leaves, nextArrayIndex, nextArrayIndex, nextArrayIndex, nextArrayIndex, nextArrayIndex, nextDirIndex, nextDirIndex, nextDirIndex, nextDirIndex, nextDirIndex, paths, paths, paths, paths, paths, queryPaths, retrieveFrom, toDataStructure, toDataStructure, toExternalPath, toLeaf, toMap, toMap, toNormalizedPath, toParentPath, toPath, toPath, toPath, toPathElements
-
Methods inherited from interface org.refcodes.structure.PropertiesAccessorMixin
asArray, asArray, asArray, asArray, asArray, asArray, asBooleanArray, asBooleanArray, asBooleanArray, asBooleanArray, asBooleanArray, asBooleanArray, asByteArray, asByteArray, asByteArray, asByteArray, asByteArray, asByteArray, asCharacterArray, asCharacterArray, asCharacterArray, asCharacterArray, asCharacterArray, asCharacterArray, asDoubleArray, asDoubleArray, asDoubleArray, asDoubleArray, asDoubleArray, asDoubleArray, asFloatArray, asFloatArray, asFloatArray, asFloatArray, asFloatArray, asFloatArray, asIntegerArray, asIntegerArray, asIntegerArray, asIntegerArray, asIntegerArray, asIntegerArray, asLongArray, asLongArray, asLongArray, asLongArray, asLongArray, asLongArray, asShortArray, asShortArray, asShortArray, asShortArray, asShortArray, asShortArray, containsKey, get, getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getCharacter, getCharacter, getCharacter, getDouble, getDouble, getDouble, getFloat, getFloat, getFloat, getInteger, getInteger, getInteger, getLong, getLong, getLong, getShort, getShort, getShort, use, useBoolean, useBoolean, useByte, useByte, useDouble, useDouble, useFloat, useFloat, useInteger, useInteger, useLong, useLong, useShort, useShort
-
-
-
-
Method Detail
-
containsValue
default boolean containsValue(java.lang.Object value)
This method is defined for the sake ofMap
conformity. Tests whether the provided value has a key assigned.- Specified by:
containsValue
in interfaceKeys<java.lang.String,T>
- Parameters:
value
- The value to test if a key references this value.- Returns:
- True in case the given value is referenced by a key.
-
getBoolean
default java.lang.Boolean getBoolean(java.lang.Object... aPathElements) throws java.lang.NumberFormatException
Returns theBoolean
value of the property referred to by the path elements. As property keys and values are of typeString
, theString
value is converted accordingly.- Parameters:
aPathElements
- The key for which to retrieve the value.- Returns:
- The
Boolean
representation of the key'sString
value of false if there is no such key. - Throws:
java.lang.NumberFormatException
- thrown in case conversion fails.
-
getBoolean
default java.lang.Boolean getBoolean(java.lang.String... aPathElements) throws java.lang.NumberFormatException
Returns theBoolean
value of the property referred to by the path elements. As property keys and values are of typeString
, theString
value is converted accordingly.- Parameters:
aPathElements
- The key for which to retrieve the value.- Returns:
- The
Boolean
representation of the key'sString
value of false if there is no such key. - Throws:
java.lang.NumberFormatException
- thrown in case conversion fails.
-
getByte
default java.lang.Byte getByte(java.lang.Object... aPathElements) throws java.lang.NumberFormatException
Returns theByte
value of the property referred to by the path elements. As property keys and values are of typeString
, theString
value is converted accordingly.- Parameters:
aPathElements
- The key for which to retrieve the value.- Returns:
- The
Byte
representation of the key'sString
value. - Throws:
java.lang.NumberFormatException
- thrown in case conversion fails.
-
getByte
default java.lang.Byte getByte(java.lang.String... aPathElements) throws java.lang.NumberFormatException
Returns theByte
value of the property referred to by the path elements. As property keys and values are of typeString
, theString
value is converted accordingly.- Parameters:
aPathElements
- The key for which to retrieve the value.- Returns:
- The
Byte
representation of the key'sString
value. - Throws:
java.lang.NumberFormatException
- thrown in case conversion fails.
-
getCharacter
default java.lang.Character getCharacter(java.lang.Object... aPathElements) throws java.lang.NumberFormatException
Returns theCharacter
value of the property referred to by the path elements. As property keys and values are of typeString
, theString
value is converted accordingly.- Parameters:
aPathElements
- The key for which to retrieve the value.- Returns:
- The
Character
representation of the key'sString
value. - Throws:
java.lang.NumberFormatException
- thrown in case conversion fails.
-
getCharacter
default java.lang.Character getCharacter(java.lang.String... aPathElements) throws java.lang.NumberFormatException
Returns theCharacter
value of the property referred to by the key. As property keys and values are of typeString
, theString
value is converted accordingly.- Parameters:
aPathElements
- The key for which to retrieve the value.- Returns:
- The
Character
representation of the key'sString
value. - Throws:
java.lang.NumberFormatException
- thrown in case conversion fails.
-
getDirAt
default CanonicalMap getDirAt(int aIndex)
An indexed directory represents all elements which begin with a path which's last path element represents an index. There may by many sub-paths for the same indexed path which are all are included by the according directory. Returns the elements of the given index below the path of the root "array" path. Given the following paths and index = 1:/0/0aaa /0/0bbb /0/0bbb /1/1aaa /1/1bbb /1/1bbb
You will get a result containing all the elements which's keys begin with "/1/". The keys of the result will exclude the path "prefix" "/1".
-
getDirAt
default CanonicalMap getDirAt(java.lang.String aPath, int aIndex)
An indexed directory represents all elements which begin with a path which's last path element represents an index. There may by many sub-paths for the same indexed path which are all are included by the according directory. Returns the elements of the given index below the path of the path "array" path. Given the following paths and index = 1 with a queried path "/root/child":/root/child/0/0aaa /root/child/0/0bbb /root/child/0/0bbb /root/child/1/1aaa /root/child/1/1bbb /root/child/1/1bbb
You will get a result containing all the elements which's keys begin with "/root/child/1/".The keys of the result will exclude the path "prefix" "/root/child/1".
-
getDouble
default java.lang.Double getDouble(java.lang.Object... aPathElements) throws java.lang.NumberFormatException
Returns theDouble
value of the property referred to by the path elements. As property keys and values are of typeString
, theString
value is converted accordingly.- Parameters:
aPathElements
- The key for which to retrieve the value.- Returns:
- The
Double
representation of the key'sString
value. - Throws:
java.lang.NumberFormatException
- thrown in case conversion fails.
-
getDouble
default java.lang.Double getDouble(java.lang.String... aPathElements) throws java.lang.NumberFormatException
Returns theDouble
value of the property referred to by the path elements. As property keys and values are of typeString
, theString
value is converted accordingly.- Parameters:
aPathElements
- The key for which to retrieve the value.- Returns:
- The
Double
representation of the key'sString
value. - Throws:
java.lang.NumberFormatException
- thrown in case conversion fails.
-
getFloat
default java.lang.Float getFloat(java.lang.Object... aPathElements) throws java.lang.NumberFormatException
Returns theFloat
value of the property referred to by the path elements. As property keys and values are of typeString
, theString
value is converted accordingly.- Parameters:
aPathElements
- The key for which to retrieve the value.- Returns:
- The
Float
representation of the key'sString
value. - Throws:
java.lang.NumberFormatException
- thrown in case conversion fails.
-
getFloat
default java.lang.Float getFloat(java.lang.String... aPathElements) throws java.lang.NumberFormatException
Returns theFloat
value of the property referred to by the path elements. As property keys and values are of typeString
, theString
value is converted accordingly.- Parameters:
aPathElements
- The key for which to retrieve the value.- Returns:
- The
Float
representation of the key'sString
value. - Throws:
java.lang.NumberFormatException
- thrown in case conversion fails.
-
getInteger
default java.lang.Integer getInteger(java.lang.Object... aPathElements) throws java.lang.NumberFormatException
Returns theInteger
value of the property referred to by the path elements. As property keys and values are of typeString
, theString
value is converted accordingly.- Parameters:
aPathElements
- The key for which to retrieve the value.- Returns:
- The
Integer
representation of the key'sString
value. - Throws:
java.lang.NumberFormatException
- thrown in case conversion fails.
-
getInteger
default java.lang.Integer getInteger(java.lang.String... aPathElements) throws java.lang.NumberFormatException
Returns theInteger
value of the property referred to by the path elements. As property keys and values are of typeString
, theString
value is converted accordingly.- Parameters:
aPathElements
- The key for which to retrieve the value.- Returns:
- The
Integer
representation of the key'sString
value. - Throws:
java.lang.NumberFormatException
- thrown in case conversion fails.
-
getLong
default java.lang.Long getLong(java.lang.Object... aPathElements) throws java.lang.NumberFormatException
Returns theLong
value of the property referred to by the path elements. As property keys and values are of typeString
, theString
value is converted accordingly.- Parameters:
aPathElements
- The key for which to retrieve the value.- Returns:
- The
Long
representation of the key'sString
value. - Throws:
java.lang.NumberFormatException
- thrown in case conversion fails.
-
getLong
default java.lang.Long getLong(java.lang.String... aPathElements) throws java.lang.NumberFormatException
Returns theLong
value of the property referred to by the path elements. As property keys and values are of typeString
, theString
value is converted accordingly.- Parameters:
aPathElements
- The key for which to retrieve the value.- Returns:
- The
Long
representation of the key'sString
value. - Throws:
java.lang.NumberFormatException
- thrown in case conversion fails.
-
getShort
default java.lang.Short getShort(java.lang.Object... aPathElements) throws java.lang.NumberFormatException
Returns theShort
value of the property referred to by the path elements. As property keys and values are of typeString
, theString
value is converted accordingly.- Parameters:
aPathElements
- The key for which to retrieve the value.- Returns:
- The
Short
representation of the key'sString
value. - Throws:
java.lang.NumberFormatException
- thrown in case conversion fails.
-
getShort
default java.lang.Short getShort(java.lang.String... aPathElements) throws java.lang.NumberFormatException
Returns theShort
value of the property referred to by the path elements. As property keys and values are of typeString
, theString
value is converted accordingly.- Parameters:
aPathElements
- The key for which to retrieve the value.- Returns:
- The
Short
representation of the key'sString
value. - Throws:
java.lang.NumberFormatException
- thrown in case conversion fails.
-
query
default CanonicalMap query(java.lang.String aPathQuery)
Queries the keys of the instance using thePathMatcher
' matching patterns, similar to the wildcards '*', '?' and '**' known when querying folders of a filesystem: ThePathMatcher
applies the following rules from the ANT path pattern to the query provided: A single asterisk ("*") matches zero or more characters within a path name. A double asterisk ("**") matches zero or more characters across directory levels. A question mark ("?") matches exactly one character within a path name. The single asterisk ("*"), the double asterisk ("**") and the question mark ("?") we refer to as wildcards.
-
query
default CanonicalMap query(java.lang.String aPathQuery, java.lang.String aFromPath, java.lang.String aToPath)
Queries the keys of the instance using thePathMatcher
' matching patterns, similar to the wildcards '*', '?' and '**' known when querying folders of a filesystem: ThePathMatcher
applies the following rules from the ANT path pattern to the query provided: A single asterisk ("*") matches zero or more characters within a path name. A double asterisk ("**") matches zero or more characters across directory levels. A question mark ("?") matches exactly one character within a path name. The single asterisk ("*"), the double asterisk ("**") and the question mark ("?") we refer to as wildcards.- Specified by:
query
in interfacePathMap<java.lang.String>
- Parameters:
aPathQuery
- The path query including your wildcards.aFromPath
- The path from where to start querying and extracting the paths.aToPath
- The path where to relocate the result to.- Returns:
- The result contains the matching paths (with respect to the from-path and the to-path) with the according values.
-
queryFrom
default CanonicalMap queryFrom(java.lang.String aPathQuery, java.lang.String aFromPath)
Queries the keys of the instance using thePathMatcher
' matching patterns, similar to the wildcards '*', '?' and '**' known when querying folders of a filesystem: ThePathMatcher
applies the following rules from the ANT path pattern to the query provided: A single asterisk ("*") matches zero or more characters within a path name. A double asterisk ("**") matches zero or more characters across directory levels. A question mark ("?") matches exactly one character within a path name. The single asterisk ("*"), the double asterisk ("**") and the question mark ("?") we refer to as wildcards.- Specified by:
queryFrom
in interfacePathMap<java.lang.String>
- Parameters:
aPathQuery
- The path query including your wildcards.aFromPath
- The path from where to start querying and extracting the paths.- Returns:
- The result contains the matching paths (with respect to the from-path) with the according values.
-
queryTo
default CanonicalMap queryTo(java.lang.String aPathQuery, java.lang.String aToPath)
Queries the keys of the instance using thePathMatcher
' matching patterns, similar to the wildcards '*', '?' and '**' known when querying folders of a filesystem: ThePathMatcher
applies the following rules from the ANT path pattern to the query provided: A single asterisk ("*") matches zero or more characters within a path name. A double asterisk ("**") matches zero or more characters across directory levels. A question mark ("?") matches exactly one character within a path name. The single asterisk ("*"), the double asterisk ("**") and the question mark ("?") we refer to as wildcards.
-
retrieve
default CanonicalMap retrieve(java.lang.String aFromPath, java.lang.String aToPath)
Extracts a newPathMap
from the elements of thisPathMap
found below the "from-path". The sub-paths will be relocated to the provided "to-path".- Specified by:
retrieve
in interfacePathMap<java.lang.String>
- Parameters:
aFromPath
- The path from where to start extracting the paths.aToPath
- The path where to relocate the extracted paths to.- Returns:
- The
PathMap
with the elements below the provided path "from-path" relocated to the given "to-path".
-
retrieveFrom
default CanonicalMap retrieveFrom(java.lang.Object aParentPath)
Gets the children elements of the provided parent's path, excluding the parent's path.- Specified by:
retrieveFrom
in interfacePathMap<java.lang.String>
- Parameters:
aParentPath
- The path from where to retrieve the children.- Returns:
- The children of the given parent's path.
-
retrieveFrom
default CanonicalMap retrieveFrom(java.lang.Object... aPathElements)
Gets the children elements of the provided parent's path elements, excluding the parent's path.- Specified by:
retrieveFrom
in interfacePathMap<java.lang.String>
- Parameters:
aPathElements
- The path elements from where to retrieve the children.- Returns:
- The children of the given parent's path.
-
retrieveFrom
CanonicalMap retrieveFrom(java.lang.String aFromPath)
Extracts a newPathMap
from the elements of thisPathMap
found below the "from-path". The sub-paths will be the root paths for the newPathMap
. Given we have a value for path "/dog/cat" in thePathMap
and we callPathMap.retrieveFrom(String)
with "/dog", then the resultingPathMap
will contain the path "/cat" for that value.- Specified by:
retrieveFrom
in interfacePathMap<java.lang.String>
- Parameters:
aFromPath
- The path from where to start extracting the paths.- Returns:
- The
PathMap
with the elements below the provided path which are root elements in the newPathMap
.
-
retrieveTo
default CanonicalMap retrieveTo(java.lang.Object aToPath)
Extracts a newPathMap
from thisPathMap
's elements with the paths relocated to the provided "to-path". Given we have a value for path "/dog/cat" in thePathMap
and we callPathMap.retrieveTo(String)
with "/animals", then the resultingPathMap
will contain the path "/animals/dog/cat" for that value.- Specified by:
retrieveTo
in interfacePathMap<java.lang.String>
- Parameters:
aToPath
- The path where to relocate the paths of thisPathMap
to.- Returns:
- The
PathMap
with the elements from the providedPathMap
with accordingly relocated paths.
-
retrieveTo
default CanonicalMap retrieveTo(java.lang.Object... aToPathElements)
Extracts a newPathMap
from thisPathMap
's elements with the paths relocated to the provided "to-path". Given we have a value for path "/dog/cat" in thePathMap
and we callPathMap.retrieveTo(String)
with "/animals", then the resultingPathMap
will contain the path "/animals/dog/cat" for that value.- Specified by:
retrieveTo
in interfacePathMap<java.lang.String>
- Parameters:
aToPathElements
- The path elements representing the path where to relocate the paths of thisPathMap
to.- Returns:
- The
PathMap
with the elements from the providedPathMap
with accordingly relocated paths.
-
retrieveTo
CanonicalMap retrieveTo(java.lang.String aToPath)
Extracts a newPathMap
from thisPathMap
's elements with the paths relocated to the provided "to-path". Given we have a value for path "/dog/cat" in thePathMap
and we callPathMap.retrieveTo(String)
with "/animals", then the resultingPathMap
will contain the path "/animals/dog/cat" for that value.- Specified by:
retrieveTo
in interfacePathMap<java.lang.String>
- Parameters:
aToPath
- The path where to relocate the paths of thisPathMap
to.- Returns:
- The
PathMap
with the elements from the providedPathMap
with accordingly relocated paths.
-
retrieveTo
default CanonicalMap retrieveTo(java.lang.String... aToPathElements)
Extracts a newPathMap
from thisPathMap
's elements with the paths relocated to the provided "to-path". Given we have a value for path "/dog/cat" in thePathMap
and we callPathMap.retrieveTo(String)
with "/animals", then the resultingPathMap
will contain the path "/animals/dog/cat" for that value.- Specified by:
retrieveTo
in interfacePathMap<java.lang.String>
- Parameters:
aToPathElements
- The path elements representing the path where to relocate the paths of thisPathMap
to.- Returns:
- The
PathMap
with the elements from the providedPathMap
with accordingly relocated paths.
-
toInstance
default <T> void toInstance(java.lang.String aFromPath, T aInstance)
Updates the instance with thisCanonicalMap
's data. Instances inside the instance may not be updated!- Type Parameters:
T
- the generic type if which to create an instance.- Parameters:
aFromPath
- The path representing the root from which to take the data for the instance.aInstance
- The instance to be updated with the herein contained data.
-
toInstance
default <T> void toInstance(T aInstance)
Updates the instance with thisCanonicalMap
's data. Instances inside the instance may not be updated!- Type Parameters:
T
- the generic type if which to create an instance.- Parameters:
aInstance
- The instance to be updated with the herein contained data.
-
toType
default <T> T toType(java.lang.Class<T> aType)
Creates an instance of the given type filled with thisCanonicalMap
's data.- Type Parameters:
T
- the generic type if which to create an instance.- Parameters:
aType
- the type if the instance to be filled with the herein contained data.- Returns:
- the instance initialized with the herein contained data.
-
toType
default <T> T toType(java.lang.String aFromPath, java.lang.Class<T> aType)
Creates an instance of the given type filled with thisCanonicalMap
's data.- Type Parameters:
T
- the generic type if which to create an instance.- Parameters:
aFromPath
- The path representing the root from which to take the data for the instance.aType
- the type if the instance to be filled with the herein contained data.- Returns:
- the instance initialized with the herein contained data.
-
-