T - the generic type of the elements to be contained herein.public class PathMapBuilderImpl<T> extends HashMap<String,T> implements PathMap.PathMapBuilder<T>
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>PathMap.MutablePathMap<T>, PathMap.PathMapBuilder<T>org.refcodes.mixin.DelimiterAccessor.DelimiterBuilder<B extends org.refcodes.mixin.DelimiterAccessor.DelimiterBuilder<B>>, org.refcodes.mixin.DelimiterAccessor.DelimiterMutator, org.refcodes.mixin.DelimiterAccessor.DelimiterPropertyorg.refcodes.mixin.TypeAccessor.TypeMutator<T>, org.refcodes.mixin.TypeAccessor.TypeProperty<T>Dictionary.MutableDictionary.DictionaryBuilder<K,V,B extends Dictionary.MutableDictionary.DictionaryBuilder<K,V,B>>Dictionary.MutableDictionary<K,V>| Constructor and Description |
|---|
PathMapBuilderImpl(char aDelimiter,
Class<T> aType)
Create a
PathMap.PathMapBuilder instance using the provided path
delimiter for the path declarations. |
PathMapBuilderImpl(Class<T> aType)
Create an empty
PathMap.PathMapBuilder instance using the default path
delimiter "/" (Delimiter.PATH) for the path declarations. |
PathMapBuilderImpl(Object aObj,
char aDelimiter,
Class<T> aType)
Creates a
PathMap.PathMapBuilder instance containing the elements as of
MutablePathMap#insert(Object). |
PathMapBuilderImpl(Object aObj,
Class<T> aType)
Create a
PathMap.PathMapBuilder instance containing the elements as of
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 a
PathMap.PathMapBuilder instance containing the elements as of
MutablePathMap#insert(Object). |
PathMapBuilderImpl(Object aObj,
String aFromPath,
Class<T> aType)
Creates a
PathMap.PathMapBuilder instance containing the elements as of
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 a
PathMap.PathMapBuilder instance containing the elements as of
MutablePathMap#insert(Object). |
PathMapBuilderImpl(String aToPath,
Object aObj,
Class<T> aType)
Create a
PathMap.PathMapBuilder instance containing the elements as of
MutablePathMap#insert(Object) using the default path delimiter
"/" (Delimiter.PATH) for the path declarations. |
PathMapBuilderImpl(String aToPath,
Object aObj,
String aFromPath,
char aDelimiter,
Class<T> aType)
Create a
PathMap.PathMapBuilder instance containing the elements as of
MutablePathMap#insert(Object). |
PathMapBuilderImpl(String aToPath,
Object aObj,
String aFromPath,
Class<T> aType)
Creates a
PathMap.PathMapBuilder instance containing the elements as of
MutablePathMap#insert(Object) using the default path delimiter
"/" (Delimiter.PATH for the path declarations. |
| Modifier and Type | Method and Description |
|---|---|
T |
compute(String aPath,
BiFunction<? super String,? super T,? extends T> remappingFunction) |
T |
computeIfAbsent(String aPath,
Function<? super String,? extends T> mappingFunction) |
T |
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.
|
T |
get(Object aPath)
Retrieves the element assigned to the given key.
|
char |
getDelimiter() |
T |
getOrDefault(Object aPath,
T publicValue) |
Class<T> |
getType() |
T |
merge(String aPath,
T value,
BiFunction<? super T,? super T,? extends T> remappingFunction) |
T |
put(String aPath,
T value)
Puts an element identified by the given key.
|
T |
putIfAbsent(String aPath,
T value) |
T |
remove(Object aPath) |
boolean |
remove(Object aPath,
Object value) |
T |
replace(String aPath,
T value) |
boolean |
replace(String aPath,
T oldValue,
T newValue) |
PathMap<T> |
retrieveFrom(String aFromPath)
|
PathMap<T> |
retrieveTo(String aToPath)
|
Object |
toDataStructure(String aPath)
Similar to the
PathMap.toMap(String) method, though in case all the keys
of a nested Map instance (applicable to the root Map as
well) represent an array (as of PathMap.getArray( String)), then an
array is generated where the index of each value in the Map is
represented by the number representation of the Map's key for
that value. |
clear, clone, containsValue, entrySet, forEach, isEmpty, keySet, putAll, replaceAll, size, valuesequals, hashCode, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitwithInsert, withInsert, withInsert, withInsert, withInsertFrom, withInsertFrom, withInsertTo, withInsertTo, withPut, withPut, withRemoveFromdelete, insert, insert, insert, insert, insertFrom, insertFrom, insertTo, insertTo, put, put, putArray, putArray, removeAlldirectories, directories, entries, entries, fromExternalKey, getArray, getArray, hasParentPath, isArray, isArray, isDirectory, isEntry, isRecord, isRootPath, keySet, paths, paths, records, records, retrieve, toDataStructure, toExternalKey, toMap, toMap, toNormalizedPath, toNormalizedPath, toParentPath, toRootPathclear, containsValue, entrySet, equals, forEach, hashCode, isEmpty, keySet, putAll, replaceAll, size, valuesisEmpty, sizepublic PathMapBuilderImpl(Class<T> aType)
PathMap.PathMapBuilder instance using the default path
delimiter "/" (Delimiter.PATH) for the path declarations.aType - The type of the values being referenced by the paths.public PathMapBuilderImpl(char aDelimiter,
Class<T> aType)
PathMap.PathMapBuilder instance using the provided path
delimiter for the path declarations.aDelimiter - The path delimiter to be used for the path
declarations.aType - The type of the values being referenced by the paths.public PathMapBuilderImpl(Object aObj, Class<T> aType)
PathMap.PathMapBuilder instance containing the elements as of
MutablePathMap#insert(Object) using the default path delimiter
"/" (Delimiter.PATH) for the path declarations.aObj - The object from which the elements are to be added.aType - The type of the values being referenced by the paths.public PathMapBuilderImpl(String aToPath, Object aObj, Class<T> aType)
PathMap.PathMapBuilder instance containing the elements as of
MutablePathMap#insert(Object) using the default path delimiter
"/" (Delimiter.PATH) for the path declarations.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.public PathMapBuilderImpl(Object aObj, String aFromPath, Class<T> aType)
PathMap.PathMapBuilder instance containing the elements as of
MutablePathMap#insert(Object) using the default path delimiter
"/" (Delimiter.PATH) for the path declarations.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.public PathMapBuilderImpl(String aToPath, Object aObj, String aFromPath, Class<T> aType)
PathMap.PathMapBuilder instance containing the elements as of
MutablePathMap#insert(Object) using the default path delimiter
"/" (Delimiter.PATH for the path declarations.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.public PathMapBuilderImpl(Object aObj, char aDelimiter, Class<T> aType)
PathMap.PathMapBuilder instance containing the elements as of
MutablePathMap#insert(Object).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.public PathMapBuilderImpl(String aToPath, Object aObj, char aDelimiter, Class<T> aType)
PathMap.PathMapBuilder instance containing the elements as of
MutablePathMap#insert(Object).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.public PathMapBuilderImpl(Object aObj, String aFromPath, char aDelimiter, Class<T> aType)
PathMap.PathMapBuilder instance containing the elements as of
MutablePathMap#insert(Object).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.public PathMapBuilderImpl(String aToPath, Object aObj, String aFromPath, char aDelimiter, Class<T> aType)
PathMap.PathMapBuilder instance containing the elements as of
MutablePathMap#insert(Object).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.public boolean containsKey(Object aPath)
containsKey in interface Map<String,T>containsKey in interface Keys<String,T>containsKey in class HashMap<String,T>aPath - The key for which to test whether there is an element.public T getOrDefault(Object aPath, T publicValue)
getOrDefault in interface Map<String,T>getOrDefault in class HashMap<String,T>public T putIfAbsent(String aPath, T value)
putIfAbsent in interface Map<String,T>putIfAbsent in class HashMap<String,T>public T computeIfAbsent(String aPath, Function<? super String,? extends T> mappingFunction)
computeIfAbsent in interface Map<String,T>computeIfAbsent in class HashMap<String,T>public T computeIfPresent(String aPath, BiFunction<? super String,? super T,? extends T> remappingFunction)
computeIfPresent in interface Map<String,T>computeIfPresent in class HashMap<String,T>public T compute(String aPath, BiFunction<? super String,? super T,? extends T> remappingFunction)
public T merge(String aPath, T value, BiFunction<? super T,? super T,? extends T> remappingFunction)
public PathMap<T> retrieveTo(String aToPath)
PathMap from this PathMap's elements with
the paths relocated to the provided "to-path".
Given we have a value for path "/dog/cat" in the PathMap and we
call PathMap.retrieveTo(String) with "/animals", then the resulting
PathMap will contain the path "/animals/dog/cat" for that value.public PathMap<T> retrieveFrom(String aFromPath)
PathMap from the elements of this PathMap
found below the "from-path". The sub-paths will be the root paths for the
new PathMap.
Given we have a value for path "/dog/cat" in the PathMap and we
call PathMap.retrieveFrom(String) with "/dog", then the resulting
PathMap will contain the path "/cat" for that value.retrieveFrom in interface PathMap<T>aFromPath - The path from where to start extracting the paths.PathMap with the elements below the provided path
which are root elements in the new PathMap.public char getDelimiter()
getDelimiter in interface org.refcodes.mixin.DelimiterAccessorpublic Class<T> getType()
getType in interface org.refcodes.mixin.TypeAccessor<T>public Object toDataStructure(String aPath)
PathMap.toMap(String) method, though in case all the keys
of a nested Map instance (applicable to the root Map as
well) represent an array (as of PathMap.getArray( String)), then an
array is generated where the index of each value in the Map is
represented by the number representation of the Map's key for
that value. The result is a data structure consisting of Map
instances and arrays.toDataStructure in interface PathMap<T>aPath - The path below which the PathMap to be converted
into a data structure.Map instances and
arrays representing the data below the given path.Copyright © 2017. All rights reserved.