@Plugin(name="IfAny", category="Core", printObject=true) public final class IfAny extends java.lang.Object implements PathCondition
PathCondition
that accepts objects that are accepted by any component conditions.
Corresponds to logical "OR".Modifier and Type | Field and Description |
---|---|
private PathCondition[] |
components |
Modifier | Constructor and Description |
---|---|
private |
IfAny(PathCondition... filters) |
Modifier and Type | Method and Description |
---|---|
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 IfAny |
createOrCondition(PathCondition... components)
Create a Composite PathCondition: accepts if any of the nested conditions accepts.
|
PathCondition[] |
getDeleteFilters() |
java.lang.String |
toString() |
private final PathCondition[] components
private IfAny(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 void beforeFileTreeWalk()
PathCondition
beforeFileTreeWalk
in interface PathCondition
@PluginFactory public static IfAny createOrCondition(@PluginElement(value="PathConditions") PathCondition... components)
components
- The component conditions.public java.lang.String toString()
toString
in class java.lang.Object