Package org.refcodes.structure
Class CanonicalMapBuilderImpl
- java.lang.Object
-
- org.refcodes.structure.PathMapBuilderImpl<java.lang.String>
-
- org.refcodes.structure.CanonicalMapBuilderImpl
-
- All Implemented Interfaces:
java.util.Map<java.lang.String,T>
,org.refcodes.mixin.DelimiterAccessor
,org.refcodes.mixin.Dumpable
,org.refcodes.mixin.TypeAccessor<java.lang.String>
,CanonicalMap
,CanonicalMap.CanonicalMapBuilder
,CanonicalMap.MutableCanonicalMap
,Clearable
,Containable
,Dictionary<java.lang.String,T>
,Dictionary.MutableDictionary<java.lang.String,T>
,Dictionary.MutableDictionary.DictionaryBuilder<java.lang.String,T,PathMap.PathMapBuilder<T>>
,Keys<java.lang.String,T>
,Keys.MutableKeys<java.lang.String,T>
,Keys.MutableValues<java.lang.String,T>
,PathMap<java.lang.String>
,PathMap.MutablePathMap<java.lang.String>
,PathMap.PathMapBuilder<java.lang.String>
,PropertiesAccessorMixin
,PropertiesAccessorMixin.PropertiesBuilderMixin<java.lang.String>
,PropertiesAccessorMixin.PropertiesMixin
,PropertiesAccessorMixin.PropertiesMutatorMixin
public class CanonicalMapBuilderImpl extends PathMapBuilderImpl<java.lang.String> implements CanonicalMap.CanonicalMapBuilder
The Class CanonicalMapBuilderImpl.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.refcodes.structure.CanonicalMap
CanonicalMap.CanonicalMapBuilder, CanonicalMap.MutableCanonicalMap
-
Nested 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.DelimiterProperty
-
Nested classes/interfaces inherited from interface org.refcodes.structure.Dictionary
Dictionary.MutableDictionary<K,V>
-
Nested classes/interfaces inherited from interface org.refcodes.structure.Dictionary.MutableDictionary
Dictionary.MutableDictionary.DictionaryBuilder<K,V,B extends Dictionary.MutableDictionary.DictionaryBuilder<K,V,B>>
-
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K extends java.lang.Object,V extends java.lang.Object>
-
Nested classes/interfaces inherited from interface org.refcodes.structure.PathMap
PathMap.MutablePathMap<T>, PathMap.PathMapBuilder<T>
-
Nested classes/interfaces inherited from interface org.refcodes.structure.PropertiesAccessorMixin
PropertiesAccessorMixin.PropertiesBuilderMixin<T>, PropertiesAccessorMixin.PropertiesMixin, PropertiesAccessorMixin.PropertiesMutatorMixin
-
-
Field Summary
-
Fields inherited from interface org.refcodes.structure.CanonicalMap
DEFAULT_COMMENT
-
Fields inherited from interface org.refcodes.structure.PathMap
DEFAULT_DELIMITER
-
-
Constructor Summary
Constructors Constructor Description CanonicalMapBuilderImpl()
Create an emptyCanonicalMap.CanonicalMapBuilder
instance using the default path delimiter "/" (Delimiter.PATH
) for the path declarations.CanonicalMapBuilderImpl(char aDelimiter)
Create aCanonicalMap.CanonicalMapBuilder
instance using the provided path delimiter for the path declarations.CanonicalMapBuilderImpl(java.lang.Object aObj)
Create aCanonicalMap.CanonicalMapBuilder
instance containing the elements as ofPathMap.MutablePathMap.insert(Object)
using the default path delimiter "/" (Delimiter.PATH
) for the path declarations.CanonicalMapBuilderImpl(java.lang.Object aObj, char aDelimiter)
Creates aCanonicalMap.CanonicalMapBuilder
instance containing the elements as ofPathMap.MutablePathMap.insert(Object)
.CanonicalMapBuilderImpl(java.lang.Object aObj, java.lang.String aFromPath)
Creates aCanonicalMap.CanonicalMapBuilder
instance containing the elements as ofPathMap.MutablePathMap.insert(Object)
using the default path delimiter "/" (Delimiter.PATH
) for the path declarations.CanonicalMapBuilderImpl(java.lang.Object aObj, java.lang.String aFromPath, char aDelimiter)
Creates aCanonicalMap.CanonicalMapBuilder
instance containing the elements as ofPathMap.MutablePathMap.insert(Object)
.CanonicalMapBuilderImpl(java.lang.String aToPath, java.lang.Object aObj)
Create aCanonicalMap.CanonicalMapBuilder
instance containing the elements as ofPathMap.MutablePathMap.insert(Object)
using the default path delimiter "/" (Delimiter.PATH
) for the path declarations.CanonicalMapBuilderImpl(java.lang.String aToPath, java.lang.Object aObj, char aDelimiter)
Creates aCanonicalMap.CanonicalMapBuilder
instance containing the elements as ofPathMap.MutablePathMap.insert(Object)
.CanonicalMapBuilderImpl(java.lang.String aToPath, java.lang.Object aObj, java.lang.String aFromPath)
Creates aCanonicalMap.CanonicalMapBuilder
instance containing the elements as ofPathMap.MutablePathMap.insert(Object)
using the default path delimiter "/" (Delimiter.PATH
for the path declarations.CanonicalMapBuilderImpl(java.lang.String aToPath, java.lang.Object aObj, java.lang.String aFromPath, char aDelimiter)
Create aCanonicalMap.CanonicalMapBuilder
instance containing the elements as ofPathMap.MutablePathMap.insert(Object)
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CanonicalMap
retrieveFrom(java.lang.String aFromPath)
CanonicalMap
retrieveTo(java.lang.String aToPath)
-
Methods inherited from interface org.refcodes.structure.CanonicalMap
getBoolean, getBoolean, getBooleanOr, getBooleanOr, getByte, getByte, getByteOr, getByteOr, getCharacter, getCharacter, getCharacterOr, getCharacterOr, getDirAt, getDirAt, getDouble, getDouble, getDoubleOr, getDoubleOr, getFloat, getFloat, getFloatOr, getFloatOr, getInteger, getInteger, getIntegerOr, getIntegerOr, getLong, getLong, getLongOr, getLongOr, getShort, getShort, getShortOr, getShortOr, query, query, query, query, queryBetween, queryBetween, queryBetween, queryBetween, queryBetween, queryFrom, queryFrom, queryFrom, queryFrom, queryFrom, queryTo, queryTo, queryTo, queryTo, queryTo, retrieveBetween, retrieveBetween, retrieveBetween, retrieveBetween, retrieveBetween, retrieveFrom, retrieveFrom, retrieveFrom, retrieveFrom, retrieveTo, retrieveTo, retrieveTo, retrieveTo, toInstance, toInstance, toMap, toProperties, toType, toType
-
Methods inherited from interface org.refcodes.structure.CanonicalMap.CanonicalMapBuilder
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, withPut, withPut, withPut, withPut, withPut, withPut, withPutBoolean, withPutBoolean, withPutBoolean, withPutBoolean, withPutBoolean, withPutByte, withPutByte, withPutByte, withPutByte, withPutByte, withPutDirAt, withPutDirAt, withPutDirAt, withPutDirAt, withPutDirAt, withPutDirAt, withPutDirAt, withPutDirAt, withPutDirAt, withPutDirAt, withPutDirAt, withPutDirAt, withPutDouble, withPutDouble, withPutDouble, withPutDouble, withPutDouble, withPutFloat, withPutFloat, withPutFloat, withPutFloat, withPutFloat, withPutInteger, withPutInteger, withPutInteger, withPutInteger, withPutInteger, withPutLong, withPutLong, withPutLong, withPutLong, withPutLong, withPutShort, withPutShort, withPutShort, withPutShort, withPutShort, withRemoveFrom, withRemoveFrom, withRemoveFrom, withRemoveFrom, withRemoveFrom
-
Methods inherited from interface org.refcodes.structure.CanonicalMap.MutableCanonicalMap
containsValue, delete, insert, insertBetween, insertFrom, insertTo, put, put, put, putAll, putAll, putAll, putBoolean, putBoolean, putByte, putByte, putDirAt, putDirAt, putDirAt, putDirAt, putDirAt, putDirAt, putDirAt, putDirAt, putDirAt, putDirAt, putDirAt, putDirAt, putDouble, putDouble, putFloat, putFloat, putInteger, putInteger, putLong, putLong, putShort, putShort, removeAll, removeAll, removeDirAt, removeDirAt, removeDirAt, removeDirAt, removeDirAt, removeFrom, removeFrom, removeFrom, removeFrom, removeFrom, toDump, toSourceCode, toSourceCode
-
Methods inherited from interface org.refcodes.structure.Containable
isEmpty, size
-
Methods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, entry, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, of, of, of, of, of, of, of, of, of, of, of, ofEntries, put, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.refcodes.structure.PathMap
children, children, children, children, children, children, containsKey, containsKey, containsKey, dirs, dirs, dirs, dirs, dirs, dirs, fromExternalPath, get, get, get, getArray, getArray, getArray, getArray, getArray, getArrayIndexes, getArrayIndexes, getArrayIndexes, getArrayIndexes, getArrayIndexes, getDirAt, getDirAt, getDirAt, getDirAt, getDirIndexes, getDirIndexes, getDirIndexes, getDirIndexes, getDirIndexes, 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, hasValueAt, hasValueAt, hasValueAt, hasValueAt, hasValueAt, hasValueAt, hasValueAt, hasValueAt, isArray, isArray, isArray, isArray, isArray, isArray, isArrayIndex, isArrayIndex, isArrayIndex, isArrayIndex, isArrayIndex, isArrayIndex, isChild, isChild, isChild, isChild, isDir, isDir, isDir, isDir, isDir, isDirIndex, isDirIndex, isDirIndex, isDirIndex, isDirIndex, isLeaf, isLeaf, isLeaf, isLeaf, isLeaf, isRootPath, 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, queryPaths, queryPaths, queryPaths, queryPaths, queryPaths, toDataStructure, toDataStructure, toExternalPath, toLeaf, toMap, toNormalizedPath, toParentPath, toPath, toPath, toPath, toPathElements, toPathList, toPropertyPath
-
Methods inherited from interface org.refcodes.structure.PathMap.MutablePathMap
appendDirTo, appendDirTo, appendDirTo, appendDirTo, appendDirTo, appendDirTo, appendDirTo, appendDirTo, appendDirTo, appendDirTo, appendDirTo, appendDirTo, appendValueTo, appendValueTo, appendValueTo, appendValueTo, appendValueTo, appendValueTo, delete, delete, delete, delete, insert, insert, insertBetween, insertBetween, insertBetween, insertBetween, insertBetween, insertBetween, insertBetween, insertBetween, insertBetween, insertBetween, insertFrom, insertFrom, insertFrom, insertFrom, insertFrom, insertFrom, insertFrom, insertFrom, insertFrom, insertFrom, insertTo, insertTo, insertTo, insertTo, insertTo, insertTo, insertTo, insertTo, insertTo, insertTo, put, putArray, putArray, putArray, putArray, putArray, putArray, putArray, putArray, putArray, putArray, putArray, putArray, putValueAt, putValueAt, putValueAt, putValueAt, putValueAt, remove, remove, removeValueAt, removeValueAt, removeValueAt, removeValueAt, removeValueAt
-
Methods inherited from class org.refcodes.structure.PathMapBuilderImpl
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, createBackingMap, entrySet, equals, forEach, get, getDelimiter, getOrDefault, getType, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, toDataStructure, toString, values
-
Methods inherited from interface org.refcodes.structure.PropertiesAccessorMixin
asArray, asArray, asArray, asArray, asBooleanArray, asBooleanArray, asBooleanArray, asBooleanArray, asByteArray, asByteArray, asByteArray, asByteArray, asCharacterArray, asCharacterArray, asCharacterArray, asCharacterArray, asDoubleArray, asDoubleArray, asDoubleArray, asDoubleArray, asFloatArray, asFloatArray, asFloatArray, asFloatArray, asIntegerArray, asIntegerArray, asIntegerArray, asIntegerArray, asLongArray, asLongArray, asLongArray, asLongArray, asShortArray, asShortArray, asShortArray, asShortArray, getBoolean, getBoolean, getBooleanOr, getBooleanOr, getByte, getByte, getByteOr, getByteOr, getCharacter, getCharacter, getCharacterOr, getCharacterOr, getDouble, getDouble, getDoubleOr, getDoubleOr, getFloat, getFloat, getFloatOr, getFloatOr, getInteger, getInteger, getIntegerOr, getIntegerOr, getLong, getLong, getLongOr, getLongOr, getShort, getShort, getShortOr, getShortOr
-
Methods inherited from interface org.refcodes.structure.PropertiesAccessorMixin.PropertiesBuilderMixin
withPut
-
Methods inherited from interface org.refcodes.structure.PropertiesAccessorMixin.PropertiesMutatorMixin
put, put, putBoolean, putBoolean, putByte, putByte, putDouble, putDouble, putFloat, putFloat, putInteger, putInteger, putLong, putLong, putShort, putShort
-
-
-
-
Constructor Detail
-
CanonicalMapBuilderImpl
public CanonicalMapBuilderImpl()
Create an emptyCanonicalMap.CanonicalMapBuilder
instance using the default path delimiter "/" (Delimiter.PATH
) for the path declarations.
-
CanonicalMapBuilderImpl
public CanonicalMapBuilderImpl(char aDelimiter)
Create aCanonicalMap.CanonicalMapBuilder
instance using the provided path delimiter for the path declarations.- Parameters:
aDelimiter
- The path delimiter to be used for the path declarations.
-
CanonicalMapBuilderImpl
public CanonicalMapBuilderImpl(java.lang.Object aObj)
Create aCanonicalMap.CanonicalMapBuilder
instance 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.
-
CanonicalMapBuilderImpl
public CanonicalMapBuilderImpl(java.lang.String aToPath, java.lang.Object aObj)
Create aCanonicalMap.CanonicalMapBuilder
instance 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.
-
CanonicalMapBuilderImpl
public CanonicalMapBuilderImpl(java.lang.Object aObj, java.lang.String aFromPath)
Creates aCanonicalMap.CanonicalMapBuilder
instance 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.
-
CanonicalMapBuilderImpl
public CanonicalMapBuilderImpl(java.lang.String aToPath, java.lang.Object aObj, java.lang.String aFromPath)
Creates aCanonicalMap.CanonicalMapBuilder
instance 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.aFromPath
- The path from where to start adding elements of the provided object.
-
CanonicalMapBuilderImpl
public CanonicalMapBuilderImpl(java.lang.Object aObj, char aDelimiter)
Creates aCanonicalMap.CanonicalMapBuilder
instance 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.
-
CanonicalMapBuilderImpl
public CanonicalMapBuilderImpl(java.lang.String aToPath, java.lang.Object aObj, char aDelimiter)
Creates aCanonicalMap.CanonicalMapBuilder
instance 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.
-
CanonicalMapBuilderImpl
public CanonicalMapBuilderImpl(java.lang.Object aObj, java.lang.String aFromPath, char aDelimiter)
Creates aCanonicalMap.CanonicalMapBuilder
instance 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.
-
CanonicalMapBuilderImpl
public CanonicalMapBuilderImpl(java.lang.String aToPath, java.lang.Object aObj, java.lang.String aFromPath, char aDelimiter)
Create aCanonicalMap.CanonicalMapBuilder
instance 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.
-
-
Method Detail
-
retrieveFrom
public CanonicalMap retrieveFrom(java.lang.String aFromPath)
Extracts a newPathMap
from the elements of thisPathMap
found 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 thePathMap
and we callPathMap.retrieveFrom(String)
with "/dog", then the resultingPathMap
will contain the path "/cat" for that value.- Specified by:
retrieveFrom
in interfaceCanonicalMap
- Specified by:
retrieveFrom
in interfacePathMap<java.lang.String>
- Overrides:
retrieveFrom
in classPathMapBuilderImpl<java.lang.String>
- Parameters:
aFromPath
- The path from where to start extracting the paths.- Returns:
- The
PathMap
with the elements below the provided path which are root elements in the newPathMap
.
-
retrieveTo
public CanonicalMap retrieveTo(java.lang.String aToPath)
Extracts a newPathMap
from thisPathMap
's elements with the paths relocated to the provided "to-path". Given we have a value for path "/dog/cat" in thePathMap
and we callPathMap.retrieveTo(String)
with "/animals", then the resultingPathMap
will contain the path "/animals/dog/cat" for that value.- Specified by:
retrieveTo
in interfaceCanonicalMap
- Specified by:
retrieveTo
in interfacePathMap<java.lang.String>
- Overrides:
retrieveTo
in classPathMapBuilderImpl<java.lang.String>
- Parameters:
aToPath
- The path where to relocate the paths of thisPathMap
to.- Returns:
- The
PathMap
with the elements from the providedPathMap
with accordingly relocated paths.
-
-