Interface CanonicalMap

    • Field Detail

      • DEFAULT_COMMENT

        static final java.lang.String DEFAULT_COMMENT
    • Method Detail

      • toType

        default <T> T toType​(java.lang.Class<T> aType)
        Creates an instance of the given type filled with this CanonicalMap's data.
        Type Parameters:
        T - the generic type if which to create an instance.
        Parameters:
        aType - the type if the instance to be filled with the herein contained data.
        Returns:
        the instance initialized with the herein contained data.
      • toType

        default <T> T toType​(java.lang.String aFromPath,
                             java.lang.Class<T> aType)
        Creates an instance of the given type filled with this CanonicalMap's data.
        Type Parameters:
        T - the generic type if which to create an instance.
        Parameters:
        aFromPath - The path representing the root from which to take the data for the instance.
        aType - the type if the instance to be filled with the herein contained data.
        Returns:
        the instance initialized with the herein contained data.
      • toInstance

        default <T> void toInstance​(T aInstance)
        Updates the instance with this CanonicalMap's data. Instances inside the instance may not be updated!
        Type Parameters:
        T - the generic type if which to create an instance.
        Parameters:
        aInstance - The instance to be updated with the herein contained data.
      • toInstance

        default <T> void toInstance​(java.lang.String aFromPath,
                                    T aInstance)
        Updates the instance with this CanonicalMap's data. Instances inside the instance may not be updated!
        Type Parameters:
        T - the generic type if which to create an instance.
        Parameters:
        aFromPath - The path representing the root from which to take the data for the instance.
        aInstance - The instance to be updated with the herein contained data.
      • containsValue

        default boolean containsValue​(java.lang.Object value)
        This method is defined for the sake of Map conformity. Tests whether the provided value has a key assigned.
        Specified by:
        containsValue in interface Keys<java.lang.String,T>
        Parameters:
        value - The value to test if a key references this value.
        Returns:
        True in case the given value is referenced by a key.
      • retrieveTo

        CanonicalMap retrieveTo​(java.lang.String aToPath)
        Extracts a new 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.
        Specified by:
        retrieveTo in interface PathMap<java.lang.String>
        Parameters:
        aToPath - The path where to relocate the paths of this PathMap to.
        Returns:
        The PathMap with the elements from the provided PathMap with accordingly relocated paths.
      • retrieveTo

        default CanonicalMap retrieveTo​(java.lang.Object aToPath)
        Extracts a new 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.
        Specified by:
        retrieveTo in interface PathMap<java.lang.String>
        Parameters:
        aToPath - The path where to relocate the paths of this PathMap to.
        Returns:
        The PathMap with the elements from the provided PathMap with accordingly relocated paths.
      • retrieveTo

        default CanonicalMap retrieveTo​(java.lang.String... aToPathElements)
        Extracts a new 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.
        Specified by:
        retrieveTo in interface PathMap<java.lang.String>
        Parameters:
        aToPathElements - The path elements representing the path where to relocate the paths of this PathMap to.
        Returns:
        The PathMap with the elements from the provided PathMap with accordingly relocated paths.
      • retrieveTo

        default CanonicalMap retrieveTo​(java.lang.Object... aToPathElements)
        Extracts a new 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.
        Specified by:
        retrieveTo in interface PathMap<java.lang.String>
        Parameters:
        aToPathElements - The path elements representing the path where to relocate the paths of this PathMap to.
        Returns:
        The PathMap with the elements from the provided PathMap with accordingly relocated paths.
      • retrieveFrom

        CanonicalMap retrieveFrom​(java.lang.String aFromPath)
        Extracts a new 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.
        Specified by:
        retrieveFrom in interface PathMap<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 new PathMap.
      • retrieveFrom

        default CanonicalMap retrieveFrom​(java.lang.Object aParentPath)
        Gets the children elements of the provided parent's path, excluding the parent's path.
        Specified by:
        retrieveFrom in interface PathMap<java.lang.String>
        Parameters:
        aParentPath - The path from where to retrieve the children.
        Returns:
        The children of the given parent's path.
      • retrieveFrom

        default CanonicalMap retrieveFrom​(java.lang.Object... aPathElements)
        Gets the children elements of the provided parent's path elements, excluding the parent's path.
        Specified by:
        retrieveFrom in interface PathMap<java.lang.String>
        Parameters:
        aPathElements - The path elements from where to retrieve the children.
        Returns:
        The children of the given parent's path.
      • retrieve

        default CanonicalMap retrieve​(java.lang.String aFromPath,
                                      java.lang.String aToPath)
        Extracts a new PathMap from the elements of this PathMap found below the "from-path". The sub-paths will be relocated to the provided "to-path".
        Specified by:
        retrieve in interface PathMap<java.lang.String>
        Parameters:
        aFromPath - The path from where to start extracting the paths.
        aToPath - The path where to relocate the extracted paths to.
        Returns:
        The PathMap with the elements below the provided path "from-path" relocated to the given "to-path".
      • getIndexed

        default CanonicalMap getIndexed​(int aIndex)
        Returns the accordingly indexed Elements of the root "array" path. Given the following paths and index = 1: /0/0aaa /0/0bbb /0/0bbb /1/1aaa /1/1bbb /1/1bbb You will get a result containing all the elements which's keys begin with "/1/".
        Specified by:
        getIndexed in interface PathMap<java.lang.String>
        Parameters:
        aIndex - The index which to use.
        Returns:
        The indexed elements without the index in the paths.
      • getIndexed

        default CanonicalMap getIndexed​(java.lang.String aPath,
                                        int aIndex)
        Returns the accordingly indexed Elements of the root "array" path. Given the following paths and index = 1 with a queried path "/root/child": /root/child/0/0aaa /root/child/0/0bbb /root/child/0/0bbb /root/child/1/1aaa /root/child/1/1bbb /root/child/1/1bbb You will get a result containing all the elements which's keys begin with "/root/child/1/".
        Specified by:
        getIndexed in interface PathMap<java.lang.String>
        Parameters:
        aPath - The path from which to get the indexed elements.
        aIndex - The index which to use.
        Returns:
        The indexed elements without the index in the paths.
      • query

        default CanonicalMap query​(java.lang.String aPathQuery)
        Queries the keys of the instance using the PathMatcher' matching patterns, similar to the wildcards '*', '?' and '**' known 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.
        Specified by:
        query in interface PathMap<java.lang.String>
        Parameters:
        aPathQuery - The path query including your wildcards.
        Returns:
        The result contains the matching paths with the according values.
      • queryTo

        default CanonicalMap queryTo​(java.lang.String aPathQuery,
                                     java.lang.String aToPath)
        Queries the keys of the instance using the PathMatcher' matching patterns, similar to the wildcards '*', '?' and '**' known 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.
        Specified by:
        queryTo in interface PathMap<java.lang.String>
        Parameters:
        aPathQuery - The path query including your wildcards.
        aToPath - The path where to relocate the result to.
        Returns:
        The result contains the matching paths (with respect to the to-path) with the according values.
      • queryFrom

        default CanonicalMap queryFrom​(java.lang.String aPathQuery,
                                       java.lang.String aFromPath)
        Queries the keys of the instance using the PathMatcher' matching patterns, similar to the wildcards '*', '?' and '**' known 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.
        Specified by:
        queryFrom in interface PathMap<java.lang.String>
        Parameters:
        aPathQuery - The path query including your wildcards.
        aFromPath - The path from where to start querying and extracting the paths.
        Returns:
        The result contains the matching paths (with respect to the from-path) with the according values.
      • query

        default CanonicalMap query​(java.lang.String aPathQuery,
                                   java.lang.String aFromPath,
                                   java.lang.String aToPath)
        Queries the keys of the instance using the PathMatcher' matching patterns, similar to the wildcards '*', '?' and '**' known 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.
        Specified by:
        query in interface PathMap<java.lang.String>
        Parameters:
        aPathQuery - The path query including your wildcards.
        aFromPath - The path from where to start querying and extracting the paths.
        aToPath - The path where to relocate the result to.
        Returns:
        The result contains the matching paths (with respect to the from-path and the to-path) with the according values.