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.AnnotatorPropertyNested 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.DelimiterPropertyNested 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.EmptyPropertyNested 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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPathMapBuilderImpl(char aDelimiter, Class<T> aType) Create aPathMap.PathMapBuilderinstance using the provided path delimiter for the path declarations.PathMapBuilderImpl(Class<T> aType) Create an emptyPathMap.PathMapBuilderinstance using the default path delimiter "/" (Delimiter.PATH) for the path declarations.PathMapBuilderImpl(Object aObj, char aDelimiter, Class<T> aType) Creates aPathMap.PathMapBuilderinstance containing the elements as ofPathMap.MutablePathMap.insert(Object).PathMapBuilderImpl(Object aObj, Class<T> aType) Create aPathMap.PathMapBuilderinstance 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.PathMapBuilderinstance containing the elements as ofPathMap.MutablePathMap.insert(Object).PathMapBuilderImpl(Object aObj, String aFromPath, Class<T> aType) Creates aPathMap.PathMapBuilderinstance 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.PathMapBuilderinstance containing the elements as ofPathMap.MutablePathMap.insert(Object).PathMapBuilderImpl(String aToPath, Object aObj, Class<T> aType) Create aPathMap.PathMapBuilderinstance containing the elements as ofPathMap.MutablePathMap.insert(Object)using the default path delimiter "/" (Delimiter.PATH) for the path declarations.Create aPathMap.PathMapBuilderinstance containing the elements as ofPathMap.MutablePathMap.insert(Object).Creates aPathMap.PathMapBuilderinstance containing the elements as ofPathMap.MutablePathMap.insert(Object)using the default path delimiter "/" (Delimiter.PATHfor the path declarations. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()computeIfAbsent(String aPath, Function<? super String, ? extends T> mappingFunction) computeIfPresent(String aPath, BiFunction<? super String, ? super T, ? extends T> remappingFunction) booleancontainsKey(Object aPath) Tests whether there is an element with the given key.booleancontainsValue(Object value) This method is defined for the sake ofMapconformity.Hook for creating an individual backingMapto be used by thePathMapBuilderImpl.entrySet()booleanvoidforEach(BiConsumer<? super String, ? super T> action) protected TfromInstance(Object aValue) Hook method when introspecting an object to help conversion of that object to the target types.fromObject(Object aFrom) protected voidHook method for intercepting or modifying the process of object introspection.protected voidRetrieves the element assigned to the given key.charchargetOrDefault(Object aPath, T publicValue) getType()inthashCode()voidInspects the given object and adds all elements found in the given object.voidinsertBetween(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.voidinsertFrom(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.voidSame asPathMap.MutablePathMap.insert(Object)though starting insertion of object's introspected values at the given "path".booleanisEmpty()keySet()Retrieves a collection containing all the keys found in the elements of this collection.voidInspects 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.voidmergeBetween(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.voidSame 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.voidSame asPathMap.MutablePathMap.merge(Object)though starting merging of object's introspected values at the given "path".Puts an element identified by the given key.voidputIfAbsent(String aPath, T value) booleanbooleanvoidreplaceAll(BiFunction<? super String, ? super T, ? extends T> function) retrieveFrom(String aFromPath) retrieveTo(String aToPath) intsize()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 nestedMapinstance (applicable to the rootMapas well) represent an array (as ofPathMap.getArray(String)), then an array is generated where the index of each value in theMapis represented by the number representation of theMap's key for that value.protected <TYPE> TYPEtoInstance(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> TYPECreates an instance of the given type filled with thisPathMap's data.values()Returns aCollectionview 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, waitMethods inherited from interface org.refcodes.mixin.Dumpable
toDump, toDumpMethods 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, toTypeMethods 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, toSourceCodeMethods 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.PathMapBuilderinstance 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.PathMapBuilderinstance 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.PathMapBuilderinstance 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.PathMapBuilderinstance 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.PathMapBuilderinstance 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.PathMapBuilderinstance containing the elements as ofPathMap.MutablePathMap.insert(Object)using the default path delimiter "/" (Delimiter.PATHfor 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.PathMapBuilderinstance 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.PathMapBuilderinstance 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.PathMapBuilderinstance 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.PathMapBuilderinstance 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:
containsKeyin interfaceKeys<String,T> - Specified by:
containsKeyin 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:
getOrDefaultin interfaceMap<String,T>
-
putIfAbsent
- Specified by:
putIfAbsentin interfaceMap<String,T>
-
remove
-
replace
-
replace
-
computeIfAbsent
- Specified by:
computeIfAbsentin interfaceMap<String,T>
-
computeIfPresent
public T computeIfPresent(String aPath, BiFunction<? super String, ? super T, ? extends T> remappingFunction) - Specified by:
computeIfPresentin interfaceMap<String,T>
-
compute
-
merge
-
retrieveTo
Extracts a newPathMapfrom thisPathMap's elements with the paths relocated to the provided "to-path". Given we have a value for path "/dog/cat" in thePathMapand we callPathMap.retrieveTo(String)with "/animals", then the resultingPathMapwill contain the path "/animals/dog/cat" for that value. -
retrieveFrom
Extracts a newPathMapfrom the elements of thisPathMapfound 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 thePathMapand we callPathMap.retrieveFrom(String)with "/dog", then the resultingPathMapwill contain the path "/cat" for that value.- Specified by:
retrieveFromin interfacePathMap<T>- Parameters:
aFromPath- The path from where to start extracting the paths.- Returns:
- The
PathMapwith the elements below the provided path which are root elements in the newPathMap.
-
getDelimiter
public char getDelimiter()- Specified by:
getDelimiterin interfaceorg.refcodes.mixin.DelimiterAccessor
-
getAnnotator
public char getAnnotator()- Specified by:
getAnnotatorin interfaceorg.refcodes.mixin.AnnotatorAccessor
-
getType
- Specified by:
getTypein interfaceorg.refcodes.mixin.TypeAccessor<T>
-
toDataStructure
Similar to thePathMap.toMap(String)method, though in case all the keys of a nestedMapinstance (applicable to the rootMapas well) represent an array (as ofPathMap.getArray(String)), then an array is generated where the index of each value in theMapis represented by the number representation of theMap's key for that value. The result is a data structure consisting ofMapinstances and arrays.- Specified by:
toDataStructurein interfacePathMap<T>- Parameters:
aFromPath- The path below which thePathMapto be converted into a data structure.- Returns:
- A data structure being a mixture of
Mapinstances 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,Collectionand arrays are identified and handled as of their type: The path for each value in aMapis appended with its according key. The path for each value in aCollectionor array is appended with its according index of occurrence (in case of aListor 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:
insertin 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:
insertBetweenin 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:
insertFromin 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:
insertToin 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,Collectionand arrays are identified and handled as of their type: The path for each value in aMapis appended with its according key. The path for each value in aCollectionor array is appended with its according index of occurrence (in case of aListor 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:
mergein 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:
mergeBetweenin 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:
mergeFromin 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:
mergeToin 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:
withPutin 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 ofMapconformity. Tests whether the provided value has a key assigned.- Specified by:
containsValuein interfaceKeys<String,T> - Specified by:
containsValuein 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 aCollectionview of the values related to the contained keys. -
entrySet
-
equals
-
hashCode
public int hashCode() -
forEach
-
replaceAll
- Specified by:
replaceAllin interfaceMap<String,T>
-
toType
Creates an instance of the given type filled with thisPathMap's data.- Specified by:
toTypein 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 backingMapto be used by thePathMapBuilderImpl.- Returns:
- The backing
Mapto be used.
-