java.lang.Object
org.refcodes.struct.PathMapBuilderImpl<T>
- Type Parameters:
T
- the generic type of the elements to be contained herein.
- All Implemented Interfaces:
Serializable
,Map<String,
,T> org.refcodes.mixin.AnnotatorAccessor
,org.refcodes.mixin.Clearable
,org.refcodes.mixin.DelimiterAccessor
,org.refcodes.mixin.Dumpable
,org.refcodes.mixin.EmptyAccessor
,org.refcodes.mixin.TypeAccessor<T>
,Containable
,Dictionary<String,
,T> Dictionary.MutableDictionary<String,
,T> Dictionary.MutableDictionary.DictionaryBuilder<String,
,T, PathMap.PathMapBuilder<T>> Keys<String,
,T> Keys.MutableKeys<String,
,T> Keys.MutableValues<String,
,T> PathMap<T>
,PathMap.MutablePathMap<T>
,PathMap.PathMapBuilder<T>
- Direct Known Subclasses:
CanonicalMapBuilderImpl
,ClassStructMapBuilderImpl
,SimpleTypeMapBuilderImpl
public class PathMapBuilderImpl<T>
extends Object
implements PathMap.PathMapBuilder<T>, Serializable
The Class PathMapBuilderImpl.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.refcodes.mixin.AnnotatorAccessor
org.refcodes.mixin.AnnotatorAccessor.AnnotatorBuilder<B extends org.refcodes.mixin.AnnotatorAccessor.AnnotatorBuilder<B>>, org.refcodes.mixin.AnnotatorAccessor.AnnotatorMutator, org.refcodes.mixin.AnnotatorAccessor.AnnotatorProperty
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.struct.Dictionary
Dictionary.MutableDictionary<K,
V> Nested classes/interfaces inherited from interface org.refcodes.struct.Dictionary.MutableDictionary
Dictionary.MutableDictionary.DictionaryBuilder<K,
V, B extends Dictionary.MutableDictionary.DictionaryBuilder<K, V, B>> Nested classes/interfaces inherited from interface org.refcodes.mixin.EmptyAccessor
org.refcodes.mixin.EmptyAccessor.EmptyMutator, org.refcodes.mixin.EmptyAccessor.EmptyProperty
Nested classes/interfaces inherited from interface org.refcodes.struct.Keys
Keys.MutableKeys<K,
V>, Keys.MutableValues<K, V> Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K extends Object,
V extends Object> Nested classes/interfaces inherited from interface org.refcodes.struct.PathMap
PathMap.MutablePathMap<T>, PathMap.PathMapBuilder<T>
Nested classes/interfaces inherited from interface org.refcodes.mixin.TypeAccessor
org.refcodes.mixin.TypeAccessor.TypeBuilder<T extends Object,
B extends org.refcodes.mixin.TypeAccessor.TypeBuilder<T, B>>, org.refcodes.mixin.TypeAccessor.TypeMutator<T extends Object>, org.refcodes.mixin.TypeAccessor.TypeProperty<T extends Object> -
Field Summary
-
Constructor Summary
ConstructorDescriptionPathMapBuilderImpl
(char aDelimiter, Class<T> aType) Create aPathMap.PathMapBuilder
instance using the provided path delimiter for the path declarations.PathMapBuilderImpl
(Class<T> aType) Create an emptyPathMap.PathMapBuilder
instance using the default path delimiter "/" (Delimiter.PATH
) for the path declarations.PathMapBuilderImpl
(Object aObj, char aDelimiter, Class<T> aType) Creates aPathMap.PathMapBuilder
instance containing the elements as ofPathMap.MutablePathMap.insert(Object)
.PathMapBuilderImpl
(Object aObj, Class<T> aType) Create aPathMap.PathMapBuilder
instance containing the elements as ofPathMap.MutablePathMap.insert(Object)
using the default path delimiter "/" (Delimiter.PATH
) for the path declarations.PathMapBuilderImpl
(Object aObj, String aFromPath, char aDelimiter, Class<T> aType) Creates aPathMap.PathMapBuilder
instance containing the elements as ofPathMap.MutablePathMap.insert(Object)
.PathMapBuilderImpl
(Object aObj, String aFromPath, Class<T> aType) Creates aPathMap.PathMapBuilder
instance containing the elements as ofPathMap.MutablePathMap.insert(Object)
using the default path delimiter "/" (Delimiter.PATH
) for the path declarations.PathMapBuilderImpl
(String aToPath, Object aObj, char aDelimiter, Class<T> aType) Creates aPathMap.PathMapBuilder
instance containing the elements as ofPathMap.MutablePathMap.insert(Object)
.PathMapBuilderImpl
(String aToPath, Object aObj, Class<T> aType) Create aPathMap.PathMapBuilder
instance containing the elements as ofPathMap.MutablePathMap.insert(Object)
using the default path delimiter "/" (Delimiter.PATH
) for the path declarations.Create aPathMap.PathMapBuilder
instance containing the elements as ofPathMap.MutablePathMap.insert(Object)
.Creates aPathMap.PathMapBuilder
instance containing the elements as ofPathMap.MutablePathMap.insert(Object)
using the default path delimiter "/" (Delimiter.PATH
for the path declarations. -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
computeIfAbsent
(String aPath, Function<? super String, ? extends T> mappingFunction) computeIfPresent
(String aPath, BiFunction<? super String, ? super T, ? extends T> remappingFunction) boolean
containsKey
(Object aPath) Tests whether there is an element with the given key.boolean
containsValue
(Object value) This method is defined for the sake ofMap
conformity.Hook for creating an individual backingMap
to be used by thePathMapBuilderImpl
.entrySet()
boolean
void
forEach
(BiConsumer<? super String, ? super T> action) protected T
fromInstance
(Object aValue) Hook method when introspecting an object to help conversion of that object to the target types.fromObject
(Object aFrom) protected void
Hook method for intercepting or modifying the process of object introspection.protected void
Retrieves the element assigned to the given key.char
char
getOrDefault
(Object aPath, T publicValue) getType()
int
hashCode()
void
Inspects the given object and adds all elements found in the given object.void
insertBetween
(String aToPath, Object aFrom, String aFromPath) Same asPathMap.MutablePathMap.insert(Object)
though starting insertion of object's introspected values at the given "to-path" and starting object introspection at the given "from-path", e.g. ignoring all paths not starting with the given path during the introspection process.void
insertFrom
(Object aFrom, String aFromPath) Same asPathMap.MutablePathMap.insert(Object)
though starting object introspection at the given "path", e.g. ignoring all paths not starting with the given path during the introspection process.void
Same asPathMap.MutablePathMap.insert(Object)
though starting insertion of object's introspected values at the given "path".boolean
isEmpty()
keySet()
Retrieves a collection containing all the keys found in the elements of this collection.void
Inspects the given object and adds all elements found in the given object in case the targeted path does not exist or points to a null value.void
mergeBetween
(String aToPath, Object aFrom, String aFromPath) Same asPathMap.MutablePathMap.merge(Object)
though starting merging of object's introspected values at the given "to-path" and starting object introspection at the given "from-path", e.g. ignoring all paths not starting with the given path during the introspection process.void
Same asPathMap.MutablePathMap.merge(Object)
though starting object introspection at the given "path", e.g. ignoring all paths not starting with the given path during the introspection process.void
Same asPathMap.MutablePathMap.merge(Object)
though starting merging of object's introspected values at the given "path".Puts an element identified by the given key.void
putIfAbsent
(String aPath, T value) boolean
boolean
void
replaceAll
(BiFunction<? super String, ? super T, ? extends T> function) retrieveFrom
(String aFromPath) retrieveTo
(String aToPath) int
size()
Returns the number of data elements contained in the collection.toDataStructure
(String aFromPath) Similar to thePathMap.toMap(String)
method, though in case all the keys of a nestedMap
instance (applicable to the rootMap
as well) represent an array (as ofPathMap.getArray(String)
), then an array is generated where the index of each value in theMap
is represented by the number representation of theMap
's key for that value.protected <TYPE> TYPE
toInstance
(T aValue, Class<TYPE> aType) Hook method when reconstructing an object, opposite offromInstance(Object)
, tries to convert the given value to the desired type.toString()
<TYPE> TYPE
Creates an instance of the given type filled with thisPathMap
's data.values()
Returns aCollection
view of the values related to the contained keys.Builder method forKeys.MutableValues.put(Object, Object)
.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.refcodes.mixin.Dumpable
toDump, toDump
Methods inherited from interface org.refcodes.struct.PathMap
children, children, children, children, children, children, containsKey, containsKey, containsKey, dirs, dirs, dirs, dirs, dirs, dirs, findPaths, fromExternalPath, get, get, get, getArray, getArray, getArray, getArray, getArray, getArrayIndexes, getArrayIndexes, getArrayIndexes, getArrayIndexes, getArrayIndexes, getArrayOr, getArrayOr, getArrayOr, getArrayOr, getArrayOr, getDir, getDir, getDir, getDir, getDir, getDirAt, getDirAt, getDirAt, getDirAt, getDirAt, getDirAt, getDirIndexes, getDirIndexes, getDirIndexes, getDirIndexes, getDirIndexes, getDirs, getDirs, getDirs, getDirs, getDirs, getRootPath, getValueAt, getValueAt, getValueAt, getValueAt, getValueAt, getValueAt, hasChildren, hasChildren, hasChildren, hasChildren, hasChildren, hasDirAt, hasDirAt, hasDirAt, hasDirAt, hasDirAt, hasDirAt, hasDirAt, hasDirAt, hasDirAt, hasDirAt, hasDirAt, hasParentPath, hasPath, hasPath, hasPath, hasPath, hasSubDirs, hasSubDirs, hasSubDirs, hasSubDirs, hasValue, hasValue, hasValue, hasValue, hasValue, hasValueAt, hasValueAt, hasValueAt, hasValueAt, hasValueAt, hasValueAt, hasValueAt, hasValueAt, isArray, isArray, isArray, isArray, isArray, isArray, isChild, isChild, isChild, isChild, isDir, isDir, isDir, isDir, isDir, isEqualTo, isIndexDir, isIndexDir, isIndexDir, isIndexDir, isIndexDir, isLeaf, isLeaf, isLeaf, isLeaf, isLeaf, isRootPath, keySet, keySet, keySet, keySet, keySet, lastArrayIndex, lastArrayIndex, lastArrayIndex, lastArrayIndex, lastArrayIndex, lastArrayIndex, lastDirIndex, lastDirIndex, lastDirIndex, lastDirIndex, lastDirIndex, lastDirIndex, leaves, leaves, leaves, leaves, leaves, leaves, nextArrayIndex, nextArrayIndex, nextArrayIndex, nextArrayIndex, nextArrayIndex, nextArrayIndex, nextDirIndex, nextDirIndex, nextDirIndex, nextDirIndex, nextDirIndex, nextDirIndex, paths, paths, paths, paths, paths, paths, query, query, query, query, query, queryBetween, queryBetween, queryBetween, queryBetween, queryBetween, queryBetween, queryFrom, queryFrom, queryFrom, queryFrom, queryFrom, queryFrom, queryPaths, queryPaths, queryPaths, queryPaths, queryPaths, queryPaths, queryTo, queryTo, queryTo, queryTo, queryTo, queryTo, retrieveBetween, retrieveBetween, retrieveBetween, retrieveBetween, retrieveBetween, retrieveFrom, retrieveFrom, retrieveFrom, retrieveFrom, retrieveTo, retrieveTo, retrieveTo, retrieveTo, sortedKeys, sortedKeys, sortedKeys, sortedKeys, sortedKeys, sortedKeys, sortedKeys, sortedKeys, sortedKeys, sortedKeys, sortedKeys, sortedKeys, sortedKeys, sortedKeys, sortedKeys, sortedKeys, sortedKeys, sortedKeys, toDataStructure, toExternalPath, toInstance, toInstance, toLeaf, toMap, toMap, toNormalizedPath, toParentPath, toPath, toPath, toPath, toPath, toPathElements, toPathList, toPathStack, toPrintable, toPropertyPath, toType, toType, toType, toType, toType, toType, toType
Methods inherited from interface org.refcodes.struct.PathMap.MutablePathMap
add, add, add, add, add, add, appendDirTo, appendDirTo, appendDirTo, appendDirTo, appendDirTo, appendDirTo, appendDirTo, appendDirTo, appendDirTo, appendDirTo, appendDirTo, appendDirTo, appendValueTo, appendValueTo, appendValueTo, appendValueTo, appendValueTo, appendValueTo, delete, delete, delete, delete, delete, fromType, fromType, fromType, fromType, fromType, fromType, fromType, fromType, insert, insertBetween, insertBetween, insertBetween, insertBetween, insertBetween, insertBetween, insertBetween, insertBetween, insertBetween, insertFrom, insertFrom, insertFrom, insertFrom, insertFrom, insertFrom, insertFrom, insertFrom, insertFrom, insertTo, insertTo, insertTo, insertTo, insertTo, insertTo, insertTo, insertTo, insertTo, merge, mergeBetween, mergeBetween, mergeBetween, mergeBetween, mergeBetween, mergeBetween, mergeBetween, mergeBetween, mergeBetween, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeTo, mergeTo, mergeTo, mergeTo, mergeTo, mergeTo, mergeTo, mergeTo, mergeTo, put, put, put, put, putArray, putArray, putArray, putArray, putArray, putArray, putArray, putArray, putArray, putArray, putArray, putArray, putDirAt, putDirAt, putDirAt, putDirAt, putDirAt, putDirAt, putDirAt, putDirAt, putDirAt, putDirAt, putDirAt, putDirAt, putValueAt, putValueAt, putValueAt, putValueAt, putValueAt, putValueAt, remove, remove, remove, removeAll, removeAll, removeAll, removeAll, removeAll, removeAll, removeDirAt, removeDirAt, removeDirAt, removeDirAt, removeDirAt, removeFrom, removeFrom, removeFrom, removeFrom, removeFrom, removePaths, removePaths, removeValueAt, removeValueAt, removeValueAt, removeValueAt, removeValueAt, toSourceCode, toSourceCode
Methods inherited from interface org.refcodes.struct.PathMap.PathMapBuilder
withInsert, withInsert, withInsertBetween, withInsertBetween, withInsertBetween, withInsertBetween, withInsertBetween, withInsertBetween, withInsertBetween, withInsertBetween, withInsertBetween, withInsertBetween, withInsertFrom, withInsertFrom, withInsertFrom, withInsertFrom, withInsertFrom, withInsertFrom, withInsertFrom, withInsertFrom, withInsertFrom, withInsertFrom, withInsertTo, withInsertTo, withInsertTo, withInsertTo, withInsertTo, withInsertTo, withInsertTo, withInsertTo, withInsertTo, withInsertTo, withMerge, withMerge, withMergeBetween, withMergeBetween, withMergeBetween, withMergeBetween, withMergeBetween, withMergeBetween, withMergeBetween, withMergeBetween, withMergeBetween, withMergeBetween, withMergeFrom, withMergeFrom, withMergeFrom, withMergeFrom, withMergeFrom, withMergeFrom, withMergeFrom, withMergeFrom, withMergeFrom, withMergeFrom, withMergeTo, withMergeTo, withMergeTo, withMergeTo, withMergeTo, withMergeTo, withMergeTo, withMergeTo, withMergeTo, withMergeTo, withPut, withPut, withPut, withPut, withPutDirAt, withPutDirAt, withPutDirAt, withPutDirAt, withPutDirAt, withPutDirAt, withPutDirAt, withPutDirAt, withPutDirAt, withPutDirAt, withPutDirAt, withPutDirAt, withRemoveFrom, withRemoveFrom, withRemoveFrom, withRemoveFrom, withRemoveFrom, withRemovePaths
-
Field Details
-
_backingMap
-
-
Constructor Details
-
PathMapBuilderImpl
Create an emptyPathMap.PathMapBuilder
instance using the default path delimiter "/" (Delimiter.PATH
) for the path declarations.- Parameters:
aType
- The type of the values being referenced by the paths.
-
PathMapBuilderImpl
Create aPathMap.PathMapBuilder
instance using the provided path delimiter for the path declarations.- Parameters:
aDelimiter
- The path delimiter to be used for the path declarations.aType
- The type of the values being referenced by the paths.
-
PathMapBuilderImpl
Create aPathMap.PathMapBuilder
instance containing the elements as ofPathMap.MutablePathMap.insert(Object)
using the default path delimiter "/" (Delimiter.PATH
) for the path declarations.- Parameters:
aObj
- The object from which the elements are to be added.aType
- The type of the values being referenced by the paths.
-
PathMapBuilderImpl
Create aPathMap.PathMapBuilder
instance containing the elements as ofPathMap.MutablePathMap.insert(Object)
using the default path delimiter "/" (Delimiter.PATH
) for the path declarations.- Parameters:
aToPath
- The sub-path where to insert the object's introspected values to.aObj
- The object from which the elements are to be added.aType
- The type of the values being referenced by the paths.
-
PathMapBuilderImpl
Creates aPathMap.PathMapBuilder
instance containing the elements as ofPathMap.MutablePathMap.insert(Object)
using the default path delimiter "/" (Delimiter.PATH
) for the path declarations.- Parameters:
aObj
- The object from which the elements are to be added.aFromPath
- The path from where to start adding elements of the provided object.aType
- The type of the values being referenced by the paths.
-
PathMapBuilderImpl
Creates aPathMap.PathMapBuilder
instance containing the elements as ofPathMap.MutablePathMap.insert(Object)
using the default path delimiter "/" (Delimiter.PATH
for the path declarations.- Parameters:
aToPath
- The sub-path where to insert the object's introspected values to.aObj
- The object from which the elements are to be added.aFromPath
- The path from where to start adding elements of the provided object.aType
- The type of the values being referenced by the paths.
-
PathMapBuilderImpl
Creates aPathMap.PathMapBuilder
instance containing the elements as ofPathMap.MutablePathMap.insert(Object)
.- Parameters:
aObj
- The object from which the elements are to be added.aDelimiter
- The path delimiter to be used for the path declarations.aType
- The type of the values being referenced by the paths.
-
PathMapBuilderImpl
Creates aPathMap.PathMapBuilder
instance containing the elements as ofPathMap.MutablePathMap.insert(Object)
.- Parameters:
aToPath
- The sub-path where to insert the object's introspected values to.aObj
- The object from which the elements are to be added.aDelimiter
- The path delimiter to be used for the path declarations.aType
- The type of the values being referenced by the paths.
-
PathMapBuilderImpl
Creates aPathMap.PathMapBuilder
instance containing the elements as ofPathMap.MutablePathMap.insert(Object)
.- Parameters:
aObj
- The object from which the elements are to be added.aFromPath
- The path from where to start adding elements of the provided object.aDelimiter
- The path delimiter to be used for the path declarations.aType
- The type of the values being referenced by the paths.
-
PathMapBuilderImpl
public PathMapBuilderImpl(String aToPath, Object aObj, String aFromPath, char aDelimiter, Class<T> aType) Create aPathMap.PathMapBuilder
instance containing the elements as ofPathMap.MutablePathMap.insert(Object)
.- Parameters:
aToPath
- The sub-path where to insert the object's introspected values to.aObj
- The object from which the elements are to be added.aFromPath
- The path from where to start adding elements of the provided object.aDelimiter
- The path delimiter to be used for the path declarations.aType
- The type of the values being referenced by the paths.
-
-
Method Details
-
containsKey
Tests whether there is an element with the given key.- Specified by:
containsKey
in interfaceKeys<String,
T> - Specified by:
containsKey
in interfaceMap<String,
T> - Parameters:
aPath
- The key for which to test whether there is an element.- Returns:
- True in case there is an element for the given key.
-
get
Retrieves the element assigned to the given key. -
put
Puts an element identified by the given key. -
remove
-
getOrDefault
- Specified by:
getOrDefault
in interfaceMap<String,
T>
-
putIfAbsent
- Specified by:
putIfAbsent
in interfaceMap<String,
T>
-
remove
-
replace
-
replace
-
computeIfAbsent
- Specified by:
computeIfAbsent
in interfaceMap<String,
T>
-
computeIfPresent
public T computeIfPresent(String aPath, BiFunction<? super String, ? super T, ? extends T> remappingFunction) - Specified by:
computeIfPresent
in interfaceMap<String,
T>
-
compute
-
merge
-
retrieveTo
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. -
retrieveFrom
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<T>
- 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
.
-
getDelimiter
public char getDelimiter()- Specified by:
getDelimiter
in interfaceorg.refcodes.mixin.DelimiterAccessor
-
getAnnotator
public char getAnnotator()- Specified by:
getAnnotator
in interfaceorg.refcodes.mixin.AnnotatorAccessor
-
getType
- Specified by:
getType
in interfaceorg.refcodes.mixin.TypeAccessor<T>
-
toDataStructure
Similar to thePathMap.toMap(String)
method, though in case all the keys of a nestedMap
instance (applicable to the rootMap
as well) represent an array (as ofPathMap.getArray(String)
), then an array is generated where the index of each value in theMap
is represented by the number representation of theMap
's key for that value. The result is a data structure consisting ofMap
instances and arrays.- Specified by:
toDataStructure
in interfacePathMap<T>
- Parameters:
aFromPath
- The path below which thePathMap
to be converted into a data structure.- Returns:
- A data structure being a mixture of
Map
instances and arrays representing the data below the given path.
-
insert
Inspects the given object and adds all elements found in the given object. Elements of typeMap
,Collection
and arrays are identified and handled as of their type: The path for each value in aMap
is appended with its according key. The path for each value in aCollection
or array is appended with its according index of occurrence (in case of aList
or an array, its actual index). In case of reflection, the path for each member is appended with its according mamber's name. All elements (e.g. the members and values) are inspected recursively which results in the according paths of the terminating values.- Specified by:
insert
in interfacePathMap.MutablePathMap<T>
- Parameters:
aFrom
- The object which is to be inspected with the therein contained values being added with their according determined paths.
-
insertBetween
Same asPathMap.MutablePathMap.insert(Object)
though starting insertion of object's introspected values at the given "to-path" and starting object introspection at the given "from-path", e.g. ignoring all paths not starting with the given path during the introspection process. The resulting paths do not start with the "from-path" path, them start with the given "to-path".- Specified by:
insertBetween
in interfacePathMap.MutablePathMap<T>
- Parameters:
aToPath
- The sub-path where to insert the object's introspected values to.aFrom
- The object which is to be inspected with the therein contained values being added with their according determined paths.aFromPath
- The path from where to start adding elements of the provided object.
-
insertFrom
Same asPathMap.MutablePathMap.insert(Object)
though starting object introspection at the given "path", e.g. ignoring all paths not starting with the given path during the introspection process. The resulting paths do not start with the provided path.- Specified by:
insertFrom
in interfacePathMap.MutablePathMap<T>
- Parameters:
aFrom
- The object which is to be inspected with the therein contained values being added with their according determined paths.aFromPath
- The path from where to start adding elements of the provided object.
-
insertTo
Same asPathMap.MutablePathMap.insert(Object)
though starting insertion of object's introspected values at the given "path".- Specified by:
insertTo
in interfacePathMap.MutablePathMap<T>
- Parameters:
aToPath
- The sub-path where to insert the object's introspected values to.aFrom
- The object which is to be inspected with the therein contained values being added with their according determined paths.
-
merge
Inspects the given object and adds all elements found in the given object in case the targeted path does not exist or points to a null value. E.g. existing path/value pairs are not overwritten. Elements of typeMap
,Collection
and arrays are identified and handled as of their type: The path for each value in aMap
is appended with its according key. The path for each value in aCollection
or array is appended with its according index of occurrence (in case of aList
or an array, its actual index). In case of reflection, the path for each member is appended with its according mamber's name. All elements (e.g. the members and values) are inspected recursively which results in the according paths of the terminating values.- Specified by:
merge
in interfacePathMap.MutablePathMap<T>
- Parameters:
aFrom
- The object which is to be inspected with the therein contained values being added with their according determined paths.
-
mergeBetween
Same asPathMap.MutablePathMap.merge(Object)
though starting merging of object's introspected values at the given "to-path" and starting object introspection at the given "from-path", e.g. ignoring all paths not starting with the given path during the introspection process. The resulting paths do not start with the "from-path" path, them start with the given "to-path".- Specified by:
mergeBetween
in interfacePathMap.MutablePathMap<T>
- Parameters:
aToPath
- The sub-path where to merge the object's introspected values to.aFrom
- The object which is to be inspected with the therein contained values being added with their according determined paths.aFromPath
- The path from where to start adding elements of the provided object.
-
mergeFrom
Same asPathMap.MutablePathMap.merge(Object)
though starting object introspection at the given "path", e.g. ignoring all paths not starting with the given path during the introspection process. The resulting paths do not start with the provided path.- Specified by:
mergeFrom
in interfacePathMap.MutablePathMap<T>
- Parameters:
aFrom
- The object which is to be inspected with the therein contained values being added with their according determined paths.aFromPath
- The path from where to start adding elements of the provided object.
-
mergeTo
Same asPathMap.MutablePathMap.merge(Object)
though starting merging of object's introspected values at the given "path".- Specified by:
mergeTo
in interfacePathMap.MutablePathMap<T>
- Parameters:
aToPath
- The sub-path where to merge the object's introspected values to.aFrom
- The object which is to be inspected with the therein contained values being added with their according determined paths.
-
withPut
Builder method forKeys.MutableValues.put(Object, Object)
.- Specified by:
withPut
in interfaceDictionary.MutableDictionary.DictionaryBuilder<String,
T, PathMap.PathMapBuilder<T>> - Parameters:
aKey
- the key for the property to be put.aValue
- the value for the property to be put.- Returns:
- The implementing instance as of the builder pattern.
-
size
public int size()Returns the number of data elements contained in the collection. -
isEmpty
public boolean isEmpty() -
containsValue
This method is defined for the sake ofMap
conformity. Tests whether the provided value has a key assigned.- Specified by:
containsValue
in interfaceKeys<String,
T> - Specified by:
containsValue
in interfaceMap<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.
-
putAll
-
clear
public void clear() -
keySet
Retrieves a collection containing all the keys found in the elements of this collection. -
values
Returns aCollection
view of the values related to the contained keys. -
entrySet
-
equals
-
hashCode
public int hashCode() -
forEach
-
replaceAll
- Specified by:
replaceAll
in interfaceMap<String,
T>
-
toType
Creates an instance of the given type filled with thisPathMap
's data.- Specified by:
toType
in interfacePathMap<T>
- Type Parameters:
TYPE
- 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.
-
toString
-
fromValue
-
fromValue
Hook method for intercepting or modifying the process of object introspection.- Parameters:
aToPath
- The sub-path where to insert the object's introspected values to.aObj
- The object from which the elements are to be added.
-
fromObject
-
fromInstance
Hook method when introspecting an object to help conversion of that object to the target types. By default this methods just tests for assignment conformity as ofClass.isAssignableFrom(Class)
with the type retrieved bygetType()
.- Parameters:
aValue
- The value which is to be transformed to the expected type as ofgetType()
.- Returns:
- The converted type or null if conversion is not possible.
-
toInstance
Hook method when reconstructing an object, opposite offromInstance(Object)
, tries to convert the given value to the desired type.- Type Parameters:
TYPE
- The type to which to convert to.- Parameters:
aValue
- The value to by converted from this instance's type as ofgetType()
to the desired type.aType
- The type to which to convert to.- Returns:
- The converted type or null if conversion is not possible.
-
createBackingMap
Hook for creating an individual backingMap
to be used by thePathMapBuilderImpl
.- Returns:
- The backing
Map
to be used.
-