@Plugin(name="IfAll", category="Core", printObject=true) public final class IfAll extends java.lang.Object implements PathCondition
PathCondition
that only accepts objects that are accepted by all component conditions.
Corresponds to logical "AND".Modifier and Type | Field and Description |
---|---|
private PathCondition[] |
components |
Modifier | Constructor and Description |
---|---|
private |
IfAll(PathCondition... filters) |
Modifier and Type | Method and Description |
---|---|
static boolean |
accept(PathCondition[] list,
java.nio.file.Path baseDir,
java.nio.file.Path relativePath,
java.nio.file.attribute.BasicFileAttributes attrs)
Returns
true if all the specified conditions accept the specified path, false otherwise. |
boolean |
accept(java.nio.file.Path baseDir,
java.nio.file.Path relativePath,
java.nio.file.attribute.BasicFileAttributes attrs)
Returns
true if the specified candidate path should be deleted, false otherwise. |
void |
beforeFileTreeWalk()
Invoked before a new file
tree walk is started.
|
static void |
beforeFileTreeWalk(PathCondition[] nestedConditions)
Calls
beforeFileTreeWalk() on all of the specified nested conditions. |
static IfAll |
createAndCondition(PathCondition... components)
Create a Composite PathCondition whose components all need to accept before this condition accepts.
|
PathCondition[] |
getDeleteFilters() |
java.lang.String |
toString() |
private final PathCondition[] components
private IfAll(PathCondition... filters)
public PathCondition[] getDeleteFilters()
public boolean accept(java.nio.file.Path baseDir, java.nio.file.Path relativePath, java.nio.file.attribute.BasicFileAttributes attrs)
PathCondition
true
if the specified candidate path should be deleted, false
otherwise.accept
in interface PathCondition
baseDir
- the directory from where to start scanning for deletion candidate filesrelativePath
- the candidate for deletion. This path is relative to the baseDir.attrs
- attributes of the candidate pathpublic static boolean accept(PathCondition[] list, java.nio.file.Path baseDir, java.nio.file.Path relativePath, java.nio.file.attribute.BasicFileAttributes attrs)
true
if all the specified conditions accept the specified path, false
otherwise.list
- the array of conditions to evaluatebaseDir
- the directory from where to start scanning for deletion candidate filesrelativePath
- the candidate for deletion. This path is relative to the baseDir.attrs
- attributes of the candidate pathtrue
if all the specified conditions accept the specified path, false
otherwisejava.lang.NullPointerException
- if any of the parameters is null
public void beforeFileTreeWalk()
PathCondition
beforeFileTreeWalk
in interface PathCondition
public static void beforeFileTreeWalk(PathCondition[] nestedConditions)
beforeFileTreeWalk()
on all of the specified nested conditions.nestedConditions
- the conditions to call beforeFileTreeWalk()
on@PluginFactory public static IfAll createAndCondition(@PluginElement(value="PathConditions") PathCondition... components)
components
- The component filters.public java.lang.String toString()
toString
in class java.lang.Object