public final class SourceFilter.Builder extends Object
SourceFilter
before creating its instance. Specify various
parameters by calling individual SourceFilter.Builder
methods. When done, call SourceFilter.Builder.build()
.Modifier and Type | Method and Description |
---|---|
SourceFilter |
build()
Finalizes and constructs the
SourceFilter instance. |
SourceFilter.Builder |
includeInternal(boolean internal)
Add a filter that includes or excludes
internal sources . |
SourceFilter.Builder |
languageIs(String... languageIds)
Add a filter for all sources that specify one of the given
language ID . |
SourceFilter.Builder |
sourceIs(Predicate<Source> predicate)
Adds custom predicate to filter inclusion of
sources . |
SourceFilter.Builder |
sourceIs(Source... source)
Add a filter for one of the given sources.
|
public SourceFilter.Builder sourceIs(Source... source)
public SourceFilter.Builder sourceIs(Predicate<Source> predicate)
sources
. The predicate must
always return the same result for a source instance otherwise the behavior is undefined.
The predicate should be able run on multiple threads at the same time.predicate
- a test for source inclusionpublic SourceFilter.Builder languageIs(String... languageIds)
language ID
.languageIds
- matches one of the given language IDpublic SourceFilter.Builder includeInternal(boolean internal)
internal sources
. By
default, internal sources are included, call with false
to exclude internal
code from instrumentation.public SourceFilter build()
SourceFilter
instance.