Class PathSet
- java.lang.Object
 - 
- org.apache.sling.api.resource.path.PathSet
 
 
- 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)static PathSetfromPathCollection(java.util.Collection<Path> paths)Create a path set from a collection of path objectsstatic PathSetfromPaths(Path... paths)Create a path set from a collection of path objectsstatic PathSetfromStringCollection(java.util.Collection<java.lang.String> paths)Create a path set from a collection of stringsstatic PathSetfromStrings(java.lang.String... strings)Create a path set from a collection of stringsPathSetgetSubset(java.lang.String path)Generate a path set of paths from this set which are in the sub tree of the provided pathPathSetgetSubset(Path path)Generate a path set of paths from this set which are in the sub tree of the provided pathPathSetgetSubset(PathSet set)Generate a path set of paths from this set which are in at least one of the sub tree of the provided path set.inthashCode()java.util.Iterator<Path>iterator()Return an unmodifiable iterator for the paths.Pathmatches(java.lang.String otherPath)Check whether the provided path is in the sub tree of any of the paths in this set.java.lang.StringtoString()java.util.Set<java.lang.String>toStringSet()Create a unmodifiable set of strings 
 - 
 
- 
- 
Field Detail
- 
EMPTY_SET
public static final PathSet EMPTY_SET
Empty path set. 
 - 
 
- 
Method Detail
- 
fromPathCollection
public static PathSet fromPathCollection(java.util.Collection<Path> paths)
Create a path set from a collection of path objects- Parameters:
 paths- The collection of path objects- Returns:
 - The path set
 
 
- 
fromPaths
public static PathSet fromPaths(Path... paths)
Create a path set from a collection of path objects- Parameters:
 paths- The collection of path objects- Returns:
 - The path set
 
 
- 
fromStringCollection
public static PathSet fromStringCollection(java.util.Collection<java.lang.String> paths)
Create a path set from a collection of strings- Parameters:
 paths- The collection of strings- Returns:
 - The path set
 
 
- 
fromStrings
public static PathSet fromStrings(java.lang.String... strings)
Create a path set from a collection of strings- Parameters:
 strings- The array of strings- Returns:
 - The path set
 
 
- 
matches
public Path matches(java.lang.String otherPath)
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, 
nullotherwise. - See Also:
 Path.matches(String)
 
- 
getSubset
public PathSet getSubset(java.lang.String path)
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
public PathSet getSubset(Path path)
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
public PathSet getSubset(PathSet set)
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
public java.util.Set<java.lang.String> toStringSet()
Create a unmodifiable set of strings- Returns:
 - A set of strings
 
 
- 
iterator
public java.util.Iterator<Path> iterator()
Return an unmodifiable iterator for the paths.- Specified by:
 iteratorin interfacejava.lang.Iterable<Path>- Returns:
 - An iterator for the paths
 
 
- 
hashCode
public int hashCode()
- Overrides:
 hashCodein classjava.lang.Object
 
- 
equals
public boolean equals(java.lang.Object obj)
- Overrides:
 equalsin classjava.lang.Object
 
- 
toString
public java.lang.String toString()
- Overrides:
 toStringin classjava.lang.Object
 
 - 
 
 -