Class PathSet
java.lang.Object
org.apache.sling.api.resource.path.PathSet
Simple helper class for path matching against a set of paths.
- Since:
- 1.0.0 (Sling API Bundle 2.11.0)
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionboolean
static PathSet
fromPathCollection
(Collection<Path> paths) Create a path set from a collection of path objectsstatic PathSet
Create a path set from a collection of path objectsstatic PathSet
fromStringCollection
(Collection<String> paths) Create a path set from a collection of stringsstatic PathSet
fromStrings
(String... strings) Create a path set from a collection of stringsGenerate a path set of paths from this set which are in the sub tree of the provided pathGenerate a path set of paths from this set which are in the sub tree of the provided pathGenerate a path set of paths from this set which are in at least one of the sub tree of the provided path set.int
hashCode()
iterator()
Return an unmodifiable iterator for the paths.Check whether the provided path is in the sub tree of any of the paths in this set.toString()
Create a unmodifiable set of stringsMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
EMPTY_SET
Empty path set.
-
-
Method Details
-
fromPathCollection
Create a path set from a collection of path objects- Parameters:
paths
- The collection of path objects- Returns:
- The path set
-
fromPaths
Create a path set from a collection of path objects- Parameters:
paths
- The collection of path objects- Returns:
- The path set
-
fromStringCollection
Create a path set from a collection of strings- Parameters:
paths
- The collection of strings- Returns:
- The path set
-
fromStrings
Create a path set from a collection of strings- Parameters:
strings
- The array of strings- Returns:
- The path set
-
matches
Check whether the provided path is in the sub tree of any of the paths in this set.- Parameters:
otherPath
- The path to match- Returns:
- The path which matches the provided path,
null
otherwise. - See Also:
-
getSubset
Generate a path set of paths from this set which are in the sub tree of the provided path- Parameters:
path
- The base path- Returns:
- Path set, might be empty
-
getSubset
Generate a path set of paths from this set which are in the sub tree of the provided path- Parameters:
path
- The base path- Returns:
- Path set, might be empty
- Since:
- 1.2.0 (Sling API Bundle 2.15.0)
-
getSubset
Generate a path set of paths from this set which are in at least one of the sub tree of the provided path set.- Parameters:
set
- The base path set- Returns:
- Path set
-
toStringSet
Create a unmodifiable set of strings- Returns:
- A set of strings
-
iterator
Return an unmodifiable iterator for the paths. -
hashCode
public int hashCode() -
equals
-
toString
-