Class ItemPathCollectionsUtil


  • public class ItemPathCollectionsUtil
    extends Object
    Methods that operate on path collections.
    • Constructor Detail

      • ItemPathCollectionsUtil

        public ItemPathCollectionsUtil()
    • Method Detail

      • containsEquivalent

        public static boolean containsEquivalent​(Collection<? extends ItemPath> paths,
                                                 ItemPath pathToBeFound)
        Returns true if the collection contains a path equivalent to pathToBeFound.
      • containsSubpath

        public static boolean containsSubpath​(Collection<? extends ItemPath> paths,
                                              ItemPath pathToBeFound)
        Returns true if the collection contains a superpath of the given path. I.e. having collection = { A/B, A/C } then the method for this collection and 'path' returns: - path = A/B -> false - path = A -> false - path = A/B/C -> true - path = X -> false
      • containsSuperpathOrEquivalent

        public static boolean containsSuperpathOrEquivalent​(Collection<? extends ItemPath> paths,
                                                            ItemPath pathToBeFound)
        Returns true if the collection contains a superpath of or equivalent path to the given path. I.e. having collection = { A/B, A/C } then the method for this collection and 'path' returns: - path = A/B -> true - path = A -> true - path = A/B/C -> false - path = X -> false
      • containsSuperpath

        public static boolean containsSuperpath​(Collection<? extends ItemPath> paths,
                                                ItemPath pathToBeFound)
        Returns true if the collection contains a superpath of the given path. I.e. having collection = { A/B, A/C } then the method for this collection and 'path' returns: - path = A/B -> false - path = A -> true - path = A/B/C -> false - path = X -> false
      • containsSubpathOrEquivalent

        public static boolean containsSubpathOrEquivalent​(Collection<? extends ItemPath> paths,
                                                          ItemPath pathToBeFound)
        Returns true if the collection contains a subpath of or equivalent path to the given path. I.e. having collection = { A/B, A/C } then the method for this collection and 'path' returns: - path = A/B -> true - path = A -> false - path = A/B/C -> true - path = X -> false
      • remainder

        public static List<ItemPath> remainder​(Collection<? extends ItemPath> paths,
                                               ItemPath prefix,
                                               boolean alsoEquivalent)
        Strips the prefix from a set of paths.
        Parameters:
        alsoEquivalent - If true, 'prefix' in paths is processed as well (resulting in empty path). Otherwise, it is skipped.
      • asPathArray

        public static ItemPath[] asPathArray​(QName... names)