T
- The type of the terminating elements.public static interface PathMap.MutablePathMap<T> extends PathMap<T>, Dictionary.MutableDictionary<String,T>, Map<String,T>
PathMap
with mutator functionality.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.DelimiterProperty
org.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>
Keys.MutableKeys<K,V>, Keys.MutableValues<K,V>
Modifier and Type | Method and Description |
---|---|
default T |
delete(String aKey)
Removes an element identified by the given key.
|
default void |
insert(Object aFrom)
Insects the given object and adds all elements found in the given
object.
|
default void |
insert(String aToPath,
Object aFrom,
String aFromPath)
Same as
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. |
default void |
insertFrom(Object aFrom,
String aFromPath)
Same as
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. |
default void |
insertTo(String aToPath,
Object aFrom)
Same as
insert(Object) though starting insertion of object's
introspected values at the given "path". |
default T |
put(Relation<String,T> aRelation)
Adds the given element related to the given key.
|
default T |
put(String aParentPath,
String aChildPath,
T aValue)
Puts the given value into the child's path, relative to the given
parent's path.
|
default T[] |
putArray(String aPath,
T[] aValues)
Sets the records below the given path in an array and replaces any
existing array.
|
default T[] |
putArray(T[] aValues)
Applies the
putArray(Object[]) method for the root path "/". |
default void |
removeAll(String aPath)
Removes all properties below the provided path.
|
default PathMap.MutablePathMap<T> |
retrieve(String aFromPath,
String aToPath)
|
PathMap.MutablePathMap<T> |
retrieveFrom(String aFromPath)
|
PathMap.MutablePathMap<T> |
retrieveTo(String aToPath)
|
directories, directories, entries, entries, fromExternalKey, getArray, getArray, hasParentPath, isArray, isArray, isDirectory, isEntry, isRecord, isRootPath, keySet, paths, paths, records, records, toDataStructure, toDataStructure, toExternalKey, toMap, toMap, toNormalizedPath, toNormalizedPath, toParentPath, toRootPath
isEmpty, size
put
containsKey, containsValue, get, keySet, use, values
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
PathMap.MutablePathMap<T> retrieveFrom(String aFromPath)
PathMap
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
.PathMap.MutablePathMap<T> retrieveTo(String aToPath)
PathMap
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.default PathMap.MutablePathMap<T> retrieve(String aFromPath, String aToPath)
PathMap
default T put(Relation<String,T> aRelation)
Dictionary.MutableDictionary
put
in interface Dictionary.MutableDictionary<String,T>
aRelation
- the a relationdefault T[] putArray(T[] aValues)
putArray(Object[])
method for the root path "/".aValues
- The values to be put.default T[] putArray(String aPath, T[] aValues)
PathMap
are reckoned to be part of an array when
they belong to the same hierarchy level and when their keys represent
integer numbers.
Given the below example, the elements below "/animals/dogs" can be
represented as an array with five elements (the path is denoted at
the left hand side of the assignment ":=" operator and the value at
the right and side accordingly):
PathMap.getArray(String)
for the
path "/animals/dogs" would contain {"ace", "bandit", "radar", "echo",
"snoopy"}. Calling isArray("/animals/dogs")
would return
true
whereas calling isArray("/animals")
would return false.aPath
- the a pathaValues
- The values to be put.default T delete(String aKey)
Keys.MutableKeys
delete
in interface Keys.MutableKeys<String,T>
aKey
- The key which's element is to be removed.default void removeAll(String aPath)
aPath
- The path from where to remove all properties.default T put(String aParentPath, String aChildPath, T aValue)
aParentPath
- The parent's path relative to which to put the
value.aChildPath
- The child's path, targets the value relative to the
parent's path.aValue
- The value to be added.default void insert(Object aFrom)
Map
, Collection
and arrays
are identified and handled as of their type: The path for each value
in a Map
is appended with its according key. The path for
each value in a Collection
or array is appended with its
according index of occurrence (in case of a List
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.aFrom
- The object which is to be inspected with the therein
contained values being added with their according determined
paths.default void insertFrom(Object aFrom, String aFromPath)
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.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.default void insertTo(String aToPath, Object aFrom)
insert(Object)
though starting insertion of object's
introspected values at the given "path".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.default void insert(String aToPath, Object aFrom, String aFromPath)
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".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.Copyright © 2017. All rights reserved.