Class MapPathTable<T>
java.lang.Object
org.refcodes.struct.MapPathTable<T>
- Type Parameters:
T- The type of the value elements.
- All Implemented Interfaces:
Serializable,Map<String,,T> org.refcodes.mixin.AnnotatorAccessor,org.refcodes.mixin.Clearable,org.refcodes.mixin.DelimiterAccessor,org.refcodes.mixin.EmptyAccessor,org.refcodes.mixin.TypeAccessor<T>,Containable,ImmutablePathTable<T>,ImmutablePathTable.MutablePathTable<T>,ImmutableTable<String,,T> ImmutableTable.MutableTable<String,,T> Keys<String,,T> Keys.MutableKeys<String,,T> Keys.MutableValues<String,,T> PathTable<T>,Table<String,T, PathTable<T>>
- Direct Known Subclasses:
MapCanonicalTable,MapClassStructTable,MapSimpleTypeTable
- 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.mixin.EmptyAccessor
org.refcodes.mixin.EmptyAccessor.EmptyBuilder<B extends org.refcodes.mixin.EmptyAccessor.EmptyBuilder<B>>, org.refcodes.mixin.EmptyAccessor.EmptyMutator, org.refcodes.mixin.EmptyAccessor.EmptyPropertyNested classes/interfaces inherited from interface org.refcodes.struct.ImmutablePathTable
ImmutablePathTable.MutablePathTable<T>Nested classes/interfaces inherited from interface org.refcodes.struct.ImmutableTable
ImmutableTable.MutableTable<K,V> Nested classes/interfaces inherited from interface org.refcodes.struct.Keys
Keys.MutableKeys<K,V>, Keys.MutableValues<K, V> Nested classes/interfaces inherited from interface org.refcodes.mixin.TypeAccessor
org.refcodes.mixin.TypeAccessor.TypeBuilder<T,B extends org.refcodes.mixin.TypeAccessor.TypeBuilder<T, B>>, org.refcodes.mixin.TypeAccessor.TypeMutator<T>, org.refcodes.mixin.TypeAccessor.TypeProperty<T> -
Field Summary
FieldsFields inherited from interface org.refcodes.struct.ImmutablePathTable
ANNOTATOR, DELIMITER -
Constructor Summary
ConstructorsConstructorDescriptionMapPathTable(char aDelimiter, Class<T> aType) Create aPathTableinstance using the provided path delimiter for the path declarations.Create aPathTableinstance using the provided path delimiter for the path declarations.MapPathTable(Class<T> aType) Create an emptyPathTableinstance using the default path delimiter "/" (Delimiter.PATH) for the path declarations.Create an emptyPathTableinstance using the default path delimiter "/" (Delimiter.PATH) for the path declarations.MapPathTable(Object aObj, char aDelimiter, Class<T> aType) Creates aPathTableinstance containing the elements as ofImmutablePathTable.MutablePathTable.insert(Object).Creates aPathTableinstance containing the elements as ofImmutablePathTable.MutablePathTable.insert(Object).MapPathTable(Object aObj, Class<T> aType) Create aPathTableinstance containing the elements as ofImmutablePathTable.MutablePathTable.insert(Object)using the default path delimiter "/" (Delimiter.PATH) for the path declarations.Create aPathTableinstance containing the elements as ofImmutablePathTable.MutablePathTable.insert(Object)using the default path delimiter "/" (Delimiter.PATH) for the path declarations.MapPathTable(Object aObj, String aFromPath, char aDelimiter, Class<T> aType) Creates aPathTableinstance containing the elements as ofImmutablePathTable.MutablePathTable.insert(Object).MapPathTable(Object aObj, String aFromPath, char aDelimiter, Class<T> aType, Map<String, T> aBackingMap) Creates aPathTableinstance containing the elements as ofImmutablePathTable.MutablePathTable.insert(Object).MapPathTable(Object aObj, String aFromPath, Class<T> aType) Creates aPathTableinstance containing the elements as ofImmutablePathTable.MutablePathTable.insert(Object)using the default path delimiter "/" (Delimiter.PATH) for the path declarations.Creates aPathTableinstance containing the elements as ofImmutablePathTable.MutablePathTable.insert(Object)using the default path delimiter "/" (Delimiter.PATH) for the path declarations.MapPathTable(String aToPath, Object aObj, char aDelimiter, Class<T> aType) Creates aPathTableinstance containing the elements as ofImmutablePathTable.MutablePathTable.insert(Object).MapPathTable(String aToPath, Object aObj, char aDelimiter, Class<T> aType, Map<String, T> aBackingMap) Creates aPathTableinstance containing the elements as ofImmutablePathTable.MutablePathTable.insert(Object).MapPathTable(String aToPath, Object aObj, Class<T> aType) Create aPathTableinstance containing the elements as ofImmutablePathTable.MutablePathTable.insert(Object)using the default path delimiter "/" (Delimiter.PATH) for the path declarations.Create aPathTableinstance containing the elements as ofImmutablePathTable.MutablePathTable.insert(Object)using the default path delimiter "/" (Delimiter.PATH) for the path declarations.Create aPathTableinstance containing the elements as ofImmutablePathTable.MutablePathTable.insert(Object).MapPathTable(String aToPath, Object aObj, String aFromPath, char aDelimiter, Class<T> aType, Map<String, T> aBackingMap) Create aPathTableinstance containing the elements as ofImmutablePathTable.MutablePathTable.insert(Object).Creates aPathTableinstance containing the elements as ofImmutablePathTable.MutablePathTable.insert(Object)using the default path delimiter "/" (Delimiter.PATHfor the path declarations.MapPathTable(String aToPath, Object aObj, String aFromPath, Class<T> aType, Map<String, T> aBackingMap) Creates aPathTableinstance containing the elements as ofImmutablePathTable.MutablePathTable.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 theUnmodifiablePathTableDecoratortype (defaults toLinkedHashMap).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.protected ImmutablePathTable<T> fromObject(Object aFrom) Hook method when internally creatingImmutablePathTablesub-types in the accordingImmutablePathTablesub-type implementations.protected voidHook method for intercepting or modifying the process of object introspection.protected voidInserts the givenObject(depending of its type) below the given path while tracking visited elements in case of introspection.Retrieves 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 asImmutablePathTable.MutablePathTable.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 asImmutablePathTable.MutablePathTable.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 asImmutablePathTable.MutablePathTable.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 asImmutablePathTable.MutablePathTable.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 asImmutablePathTable.MutablePathTable.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 asImmutablePathTable.MutablePathTable.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) Extracts a newPathTablefrom the elements of this instance found below the "from-path".retrieveTo(String aToPath) Extracts a newPathTablefrom this instance's elements with the paths relocated to the provided "to-path".intsize()Returns the number of data elements contained in the collection.toDataStructure(String aFromPath) Similar to theImmutablePathTable.toMap(String)method, though in case all the keys of a nestedMapinstance (applicable to the rootMapas well) represent an array (as ofImmutablePathTable.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 this instance'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.struct.ImmutablePathTable
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, getArray, getArrayIndexes, getArrayIndexes, getArrayIndexes, getArrayIndexes, getArrayIndexes, getArrayOr, getArrayOr, getArrayOr, getArrayOr, getArrayOr, getArrayOr, getDir, getDir, getDir, getDir, getDir, getDirAt, getDirAt, getDirAt, getDirAt, getDirAt, getDirAt, getDirIndexes, 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, 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.ImmutablePathTable.MutablePathTable
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.PathTable
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
-
MapPathTable
-
MapPathTable
-
MapPathTable
Create aPathTableinstance containing the elements as ofImmutablePathTable.MutablePathTable.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.
-
MapPathTable
Create aPathTableinstance containing the elements as ofImmutablePathTable.MutablePathTable.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.
-
MapPathTable
Creates aPathTableinstance containing the elements as ofImmutablePathTable.MutablePathTable.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.
-
MapPathTable
Creates aPathTableinstance containing the elements as ofImmutablePathTable.MutablePathTable.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.
-
MapPathTable
Creates aPathTableinstance containing the elements as ofImmutablePathTable.MutablePathTable.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.
-
MapPathTable
Creates aPathTableinstance containing the elements as ofImmutablePathTable.MutablePathTable.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.
-
MapPathTable
Creates aPathTableinstance containing the elements as ofImmutablePathTable.MutablePathTable.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.
-
MapPathTable
Create aPathTableinstance containing the elements as ofImmutablePathTable.MutablePathTable.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.
-
MapPathTable
-
MapPathTable
-
MapPathTable
Create aPathTableinstance containing the elements as ofImmutablePathTable.MutablePathTable.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.aBackingMap- The backing map used as underlyingMapinstance.
-
MapPathTable
Create aPathTableinstance containing the elements as ofImmutablePathTable.MutablePathTable.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.aBackingMap- The backing map used as underlyingMapinstance.
-
MapPathTable
Creates aPathTableinstance containing the elements as ofImmutablePathTable.MutablePathTable.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.aBackingMap- The backing map used as underlyingMapinstance.
-
MapPathTable
public MapPathTable(String aToPath, Object aObj, String aFromPath, Class<T> aType, Map<String, T> aBackingMap) Creates aPathTableinstance containing the elements as ofImmutablePathTable.MutablePathTable.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.aBackingMap- The backing map used as underlyingMapinstance.
-
MapPathTable
Creates aPathTableinstance containing the elements as ofImmutablePathTable.MutablePathTable.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.aBackingMap- The backing map used as underlyingMapinstance.
-
MapPathTable
public MapPathTable(String aToPath, Object aObj, char aDelimiter, Class<T> aType, Map<String, T> aBackingMap) Creates aPathTableinstance containing the elements as ofImmutablePathTable.MutablePathTable.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.aBackingMap- The backing map used as underlyingMapinstance.
-
MapPathTable
public MapPathTable(Object aObj, String aFromPath, char aDelimiter, Class<T> aType, Map<String, T> aBackingMap) Creates aPathTableinstance containing the elements as ofImmutablePathTable.MutablePathTable.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.aBackingMap- The backing map used as underlyingMapinstance.
-
MapPathTable
public MapPathTable(String aToPath, Object aObj, String aFromPath, char aDelimiter, Class<T> aType, Map<String, T> aBackingMap) Create aPathTableinstance containing the elements as ofImmutablePathTable.MutablePathTable.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.aBackingMap- The backing map used as underlyingMapinstance.
-
-
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
-
putIfAbsent
-
remove
-
replace
-
replace
-
computeIfAbsent
-
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 newPathTablefrom this instance's elements with the paths relocated to the provided "to-path". Given we have a value for path "/dog/cat" in thePathTableand we callImmutablePathTable.retrieveTo(String)with "/animals", then the resultingPathTablewill contain the path "/animals/dog/cat" for that value.- Specified by:
retrieveToin interfaceImmutablePathTable<T>- Parameters:
aToPath- The path where to relocate the paths of thisPathTableto.- Returns:
- The
PathTablewith the elements from the providedPathTablewith accordingly relocated paths.
-
retrieveFrom
Extracts a newPathTablefrom the elements of this instance found below the "from-path". The sub-paths will be the root paths for the newPathTable. Given we have a value for path "/dog/cat" in thePathTableand we callImmutablePathTable.retrieveFrom(String)with "/dog", then the resultingPathTablewill contain the path "/cat" for that value.- Specified by:
retrieveFromin interfaceImmutablePathTable<T>- Parameters:
aFromPath- The path from where to start extracting the paths.- Returns:
- The
PathTablewith the elements below the provided path which are root elements in the newPathTable.
-
getDelimiter
public char getDelimiter()- Specified by:
getDelimiterin interfaceorg.refcodes.mixin.DelimiterAccessor
-
getAnnotator
public char getAnnotator()- Specified by:
getAnnotatorin interfaceorg.refcodes.mixin.AnnotatorAccessor
-
getType
-
toDataStructure
Similar to theImmutablePathTable.toMap(String)method, though in case all the keys of a nestedMapinstance (applicable to the rootMapas well) represent an array (as ofImmutablePathTable.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 interfaceImmutablePathTable<T>- Parameters:
aFromPath- The path below which this instance is to 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 interfaceImmutablePathTable.MutablePathTable<T>- Parameters:
aFrom- The object which is to be inspected with the therein contained values being added with their according determined paths.
-
insertBetween
Same asImmutablePathTable.MutablePathTable.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 interfaceImmutablePathTable.MutablePathTable<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 asImmutablePathTable.MutablePathTable.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 interfaceImmutablePathTable.MutablePathTable<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 asImmutablePathTable.MutablePathTable.insert(Object)though starting insertion of object's introspected values at the given "path".- Specified by:
insertToin interfaceImmutablePathTable.MutablePathTable<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 interfaceImmutablePathTable.MutablePathTable<T>- Parameters:
aFrom- The object which is to be inspected with the therein contained values being added with their according determined paths.
-
mergeBetween
Same asImmutablePathTable.MutablePathTable.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 interfaceImmutablePathTable.MutablePathTable<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 asImmutablePathTable.MutablePathTable.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 interfaceImmutablePathTable.MutablePathTable<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 asImmutablePathTable.MutablePathTable.merge(Object)though starting merging of object's introspected values at the given "path".- Specified by:
mergeToin interfaceImmutablePathTable.MutablePathTable<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). -
size
-
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
-
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
-
forEach
-
replaceAll
- Specified by:
replaceAllin interfaceMap<String,T>
-
toType
Creates an instance of the given type filled with this instance's data.- Specified by:
toTypein interfaceImmutablePathTable<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.
-
equals
-
hashCode
-
toString
-
fromValue
Inserts the givenObject(depending of its type) below the given path while tracking visited elements in case of introspection.- Parameters:
aToPath- The path below which to insert.aValue- The value to be inserted.aVisited- The visited elements for preventing turning circles (cyclic references).
-
fromValue
-
fromObject
Hook method when internally creatingImmutablePathTablesub-types in the accordingImmutablePathTablesub-type implementations.- Parameters:
aFrom- TheObjectfrom which to create aImmutablePathTable(sub-type) instance.- Returns:
- The according
ImmutablePathTable(sub-type) instance.
-
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 theUnmodifiablePathTableDecoratortype (defaults toLinkedHashMap).- Returns:
- The backing
Mapto be used.
-