T
- the generic type of the elements to be contained herein.Serializable
, Cloneable
, Map<String,T>
, org.refcodes.mixin.DelimiterAccessor
, org.refcodes.mixin.Dumpable
, org.refcodes.mixin.TypeAccessor<T>
, Clearable
, 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>
CanonicalMapBuilderImpl
public class PathMapBuilderImpl<T> extends HashMap<String,T> implements PathMap.PathMapBuilder<T>
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
org.refcodes.mixin.DelimiterAccessor.DelimiterBuilder<B extends org.refcodes.mixin.DelimiterAccessor.DelimiterBuilder<B>>, org.refcodes.mixin.DelimiterAccessor.DelimiterMutator, org.refcodes.mixin.DelimiterAccessor.DelimiterProperty
Dictionary.MutableDictionary<K,V>
Dictionary.MutableDictionary.DictionaryBuilder<K,V,B extends Dictionary.MutableDictionary.DictionaryBuilder<K,V,B>>
Map.Entry<K extends Object,V extends Object>
PathMap.MutablePathMap<T>, PathMap.PathMapBuilder<T>
Constructor | 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
PathMap.MutablePathMap.insert(Object) . |
PathMapBuilderImpl(Object aObj,
Class<T> aType) |
Create a
PathMap.PathMapBuilder instance containing the elements as of
PathMap.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
PathMap.MutablePathMap.insert(Object) . |
PathMapBuilderImpl(Object aObj,
String aFromPath,
Class<T> aType) |
Creates a
PathMap.PathMapBuilder instance containing the elements as of
PathMap.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
PathMap.MutablePathMap.insert(Object) . |
PathMapBuilderImpl(String aToPath,
Object aObj,
Class<T> aType) |
Create a
PathMap.PathMapBuilder instance containing the elements as of
PathMap.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
PathMap.MutablePathMap.insert(Object) . |
PathMapBuilderImpl(String aToPath,
Object aObj,
String aFromPath,
Class<T> aType) |
Creates a
PathMap.PathMapBuilder instance containing the elements as of
PathMap.MutablePathMap.insert(Object) using the default path delimiter
"/" (Delimiter.PATH for the path declarations. |
Modifier and Type | Method | Description |
---|---|---|
PathMap<T> |
childrenOf(String aParentPath) |
Gets the children elements of the provided parent's path, excluding the
parent's path.
|
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 aFromPath) |
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. |
equals, hashCode, toString
isEmpty, size
clear, clone, containsValue, entrySet, forEach, isEmpty, keySet, putAll, replaceAll, size, values
clear, containsValue, entrySet, equals, forEach, hashCode, isEmpty, keySet, putAll, replaceAll, size, values
finalize, getClass, notify, notifyAll, wait, wait, wait
directories, directories, entries, entries, fromExternalKey, getArray, getArray, getRootPath, hasParentPath, isArray, isArray, isDirectory, isEntry, isRecord, isRootPath, keySet, paths, paths, records, records, retrieve, toDataStructure, toExternalKey, toMap, toMap, toNormalizedPath, toNormalizedPath, toParentPath, toPath
delete, insert, insert, insert, insert, insertFrom, insertFrom, insertTo, insertTo, put, put, putArray, putArray, removeAll
withInsert, withInsert, withInsert, withInsert, withInsertFrom, withInsertFrom, withInsertTo, withInsertTo, withPut, withPut, withRemoveFrom
public 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
PathMap.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
PathMap.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
PathMap.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
PathMap.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
PathMap.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
PathMap.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
PathMap.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
PathMap.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 Keys<String,T>
containsKey
in interface Map<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> childrenOf(String aParentPath)
childrenOf
in interface PathMap<T>
aParentPath
- The path from where to retrieve the children.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.DelimiterAccessor
public Class<T> getType()
getType
in interface org.refcodes.mixin.TypeAccessor<T>
public Object toDataStructure(String aFromPath)
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>
aFromPath
- 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 © 2018. All rights reserved.