Class AbstractFilePredicate
java.lang.Object
org.sonar.api.batch.fs.internal.predicates.AbstractFilePredicate
- All Implemented Interfaces:
Comparable<OptimizedFilePredicate>,org.sonar.api.batch.fs.FilePredicate,OptimizedFilePredicate
- Direct Known Subclasses:
FileExtensionPredicate,FilenamePredicate,IsPredicate,OptimizedFilePredicateAdapter,RelativePathPredicate,StatusPredicate
Partial implementation of
OptimizedFilePredicate.- Since:
- 5.1
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intprotected static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal intIterable<org.sonar.api.batch.fs.InputFile>Filter provided files to keep only the ones that are valid for this predicateIterable<org.sonar.api.batch.fs.InputFile>get(org.sonar.api.batch.fs.FileSystem.Index index) Get all files that are valid for this predicate.intpriority()For optimization.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.sonar.api.batch.fs.FilePredicate
apply
-
Field Details
-
DEFAULT_PRIORITY
protected static final int DEFAULT_PRIORITY- See Also:
-
USE_INDEX
protected static final int USE_INDEX- See Also:
-
-
Constructor Details
-
AbstractFilePredicate
public AbstractFilePredicate()
-
-
Method Details
-
filter
public Iterable<org.sonar.api.batch.fs.InputFile> filter(Iterable<org.sonar.api.batch.fs.InputFile> target) Description copied from interface:OptimizedFilePredicateFilter provided files to keep only the ones that are valid for this predicate- Specified by:
filterin interfaceOptimizedFilePredicate
-
get
public Iterable<org.sonar.api.batch.fs.InputFile> get(org.sonar.api.batch.fs.FileSystem.Index index) Description copied from interface:OptimizedFilePredicateGet all files that are valid for this predicate.- Specified by:
getin interfaceOptimizedFilePredicate
-
priority
public int priority()Description copied from interface:OptimizedFilePredicateFor optimization. FilePredicates will be applied in priority order. For example when doing p.and(p1, p2, p3) then p1, p2 and p3 will be applied according to their priority value. Higher priority value are applied first. Assign a high priority when the predicate will likely highly reduce the set of InputFiles to filter. AlsoRelativePathPredicateand AbsolutePathPredicate have a high priority since they are using cache index.- Specified by:
priorityin interfaceOptimizedFilePredicate
-
compareTo
- Specified by:
compareToin interfaceComparable<OptimizedFilePredicate>
-