Interface OptimizedFilePredicate
- All Superinterfaces:
Comparable<OptimizedFilePredicate>
,org.sonar.api.batch.fs.FilePredicate
- All Known Implementing Classes:
AbstractFilePredicate
,FileExtensionPredicate
,FilenamePredicate
,OptimizedFilePredicateAdapter
,RelativePathPredicate
,StatusPredicate
public interface OptimizedFilePredicate
extends org.sonar.api.batch.fs.FilePredicate, Comparable<OptimizedFilePredicate>
Optimized version of FilePredicate allowing to speed up query by looking at InputFile by index.
-
Method Summary
Modifier and TypeMethodDescriptionIterable<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.int
priority()
For optimization.Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface org.sonar.api.batch.fs.FilePredicate
apply
-
Method Details
-
filter
Iterable<org.sonar.api.batch.fs.InputFile> filter(Iterable<org.sonar.api.batch.fs.InputFile> inputFiles) Filter provided files to keep only the ones that are valid for this predicate -
get
Get all files that are valid for this predicate. -
priority
int priority()For 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. AlsoRelativePathPredicate
and AbsolutePathPredicate have a high priority since they are using cache index.
-