Interface PathMap.MutablePathMap<T>

    • Method Detail

      • put

        default T put​(Relation<java.lang.String,T> aRelation)
        Adds the given element related to the given key.
        Specified by:
        put in interface Dictionary.MutableDictionary<java.lang.String,T>
        Parameters:
        aRelation - the relation
        Returns:
        The value being replaced by the provided value or null if none value has been replaced.
      • putArray

        default T[] putArray​(T[] aValues)
        Applies the putArray(Object[]) method for the root path "/".
        Parameters:
        aValues - The values to be put.
        Returns:
        An array of the records being replaced by the provided elements.
      • putArray

        default T[] putArray​(java.lang.String aPath,
                             T[] aValues)
        Sets the records below the given path in an array and replaces any existing array. Records in a 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):
        • "/animals/dogs/0" := "ace"
        • "/animals/dogs/1" := "bandit"
        • "/animals/dogs/2" := "radar"
        • "/animals/dogs/3" := "echo"
        • "/animals/dogs/4" := "snoopy"
        The resulting array when calling 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.
        Parameters:
        aPath - the path
        aValues - The values to be put.
        Returns:
        An array of the records being replaced by the provided elements.
      • delete

        default T delete​(java.lang.String aKey)
        Removes an element identified by the given key.
        Specified by:
        delete in interface Keys.MutableKeys<java.lang.String,T>
        Parameters:
        aKey - The key which's element is to be removed.
        Returns:
        The value being removed.
      • removeFrom

        default void removeFrom​(java.lang.String aPath)
        Removes all properties below the provided path.
        Parameters:
        aPath - The path from where to remove all properties.
      • removeFrom

        default void removeFrom​(java.lang.String... aPathElements)
        Removes all properties as of removeFrom(String) below the provided resulting path (as of PathMap.toPath(String...)).
        Parameters:
        aPathElements - The elements of the path from where to remove all properties.
      • removeFrom

        default void removeFrom​(java.lang.Object... aPathElements)
        Removes all properties as of removeFrom(String) below the provided resulting path (as of PathMap.toPath(String...)).
        Parameters:
        aPathElements - The elements of the path from where to remove all properties.
      • removeFrom

        default void removeFrom​(java.lang.Object aPath)
        Removes all properties as of removeFrom(String) below the provided resulting path (as of PathMap.toPath(Object...)).
        Parameters:
        aPath - The path from where to remove all properties.
      • remove

        default T remove​(java.lang.String... aPathElements)
        Removes the property as of Map.remove(Object) for the provided path elements (as of PathMap.toPath(String...)).
        Parameters:
        aPathElements - The elements of the path from where to remove the property.
        Returns:
        the previous value associated with the according path, or null if there was no mapping for the according path.
      • removeAll

        default void removeAll​(java.lang.String aPathQuery)
        Removes all elements which's keys match the provided path query. Queries the keys of the instance using the PathMatcher' matching patterns, similar to the wildcards '*', '?' and '**' knwon when querying folders of a filesystem: The PathMatcher applies the following rules from the ANT path pattern to the query provided: A single asterisk ("*") matches zero or more characters within a path name. A double asterisk ("**") matches zero or more characters across directory levels. A question mark ("?") matches exactly one character within a path name. The single asterisk ("*"), the double asterisk ("**") and the question mark ("?") we refer to as wildcards.
        Parameters:
        aPathQuery - The path query including your wildcards.
      • removeAll

        default void removeAll​(java.util.Set<java.lang.String> aPaths)
        Removes the paths contained in the provided collection.
        Parameters:
        aPaths - The paths to be removed.
      • remove

        default T remove​(java.lang.Object... aPathElements)
        Removes the property as of Map.remove(Object) for the provided path elements (as of PathMap.toPath(Object...)).
        Parameters:
        aPathElements - The elements of the path from where to remove the property.
        Returns:
        the previous value associated with the according path, or null if there was no mapping for the according path.
      • put

        default T put​(java.lang.String aParentPath,
                      java.lang.String aChildPath,
                      T aValue)
        Puts the given value into the child's path, relative to the given parent's path.
        Parameters:
        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.
        Returns:
        The replaced value in case a value has already been set for the resulting path, or null.
      • insert

        default void insert​(java.lang.Object aFrom)
        Inspects the given object and adds all elements found in the given object. Elements of type 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.
        Parameters:
        aFrom - The object which is to be inspected with the therein contained values being added with their according determined paths.
      • insertFrom

        default void insertFrom​(java.lang.Object aFrom,
                                java.lang.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. The resulting paths do not start with the provided path.
        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

        default void insertTo​(java.lang.String aToPath,
                              java.lang.Object aFrom)
        Same as insert(Object) though starting insertion of object's introspected values at the given "path".
        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.
      • insert

        default void insert​(java.lang.String aToPath,
                            java.lang.Object aFrom,
                            java.lang.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. The resulting paths do not start with the "from-path" path, them start with the given "to-path".
        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.
      • insert

        default void insert​(PathMap<T> aFrom)
        Method to semantically emphasize that we support our own types. Actually delegates to insert(Object).
        Parameters:
        aFrom - The PathMap which is to be inspected with the therein contained values being added with their according determined paths.
      • insertFrom

        default void insertFrom​(PathMap<T> aFrom,
                                java.lang.String aFromPath)
        Method to semantically emphasize that we support our own types. Actually delegates to insertFrom(Object, String).
        Parameters:
        aFrom - The PathMap 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

        default void insertTo​(java.lang.String aToPath,
                              PathMap<T> aFrom)
        Method to semantically emphasize that we support our own types. Actually delegates to insertTo(String, Object).
        Parameters:
        aToPath - The sub-path where to insert the object's introspected values to.
        aFrom - The PathMap which is to be inspected with the therein contained values being added with their according determined paths.
      • insert

        default void insert​(java.lang.String aToPath,
                            PathMap<T> aFrom,
                            java.lang.String aFromPath)
        Method to semantically emphasize that we support our own types. Actually delegates to insert(String, Object, String).
        Parameters:
        aToPath - The sub-path where to insert the object's introspected values to.
        aFrom - The PathMap 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.