Class DetectorOptions.Builder
- java.lang.Object
-
- com.puppycrawl.tools.checkstyle.checks.regexp.DetectorOptions.Builder
-
- Enclosing class:
- DetectorOptions
public final class DetectorOptions.Builder extends Object
Class which implements Builder pattern to build DetectorOptions instance.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DetectorOptions
build()
Returns new DetectorOptions instance.DetectorOptions.Builder
compileFlags(int val)
Specifies the compile-flags to compile a regular expression with and returns Builder object.private Pattern
createPattern(String formatValue)
Creates pattern to use by DetectorOptions instance.DetectorOptions.Builder
format(String val)
Specifies the format to use when matching lines and returns Builder object.DetectorOptions.Builder
ignoreCase(boolean val)
Specifies whether to ignore case when matching and returns Builder object.DetectorOptions.Builder
maximum(int val)
Specifies the maximum allowed number of detections and returns Builder object.DetectorOptions.Builder
message(String val)
Specifies message to use when reporting a match and returns Builder object.DetectorOptions.Builder
minimum(int val)
Specifies the minimum allowed number of detections and returns Builder object.DetectorOptions.Builder
reporter(AbstractViolationReporter val)
Specifies the violation reporter and returns Builder object.DetectorOptions.Builder
suppressor(MatchSuppressor val)
Specifies the suppressor to use and returns Builder object.
-
-
-
Constructor Detail
-
Builder
public Builder()
-
-
Method Detail
-
reporter
public DetectorOptions.Builder reporter(AbstractViolationReporter val)
Specifies the violation reporter and returns Builder object.- Parameters:
val
- for reporting violations.- Returns:
- Builder object.
-
compileFlags
public DetectorOptions.Builder compileFlags(int val)
Specifies the compile-flags to compile a regular expression with and returns Builder object.- Parameters:
val
- the format to use when matching lines.- Returns:
- Builder object.
-
format
public DetectorOptions.Builder format(String val)
Specifies the format to use when matching lines and returns Builder object.- Parameters:
val
- the format to use when matching lines.- Returns:
- Builder object.
-
message
public DetectorOptions.Builder message(String val)
Specifies message to use when reporting a match and returns Builder object.- Parameters:
val
- message to use when reporting a match.- Returns:
- Builder object.
-
minimum
public DetectorOptions.Builder minimum(int val)
Specifies the minimum allowed number of detections and returns Builder object.- Parameters:
val
- the minimum allowed number of detections.- Returns:
- Builder object.
-
maximum
public DetectorOptions.Builder maximum(int val)
Specifies the maximum allowed number of detections and returns Builder object.- Parameters:
val
- the maximum allowed number of detections.- Returns:
- Builder object.
-
ignoreCase
public DetectorOptions.Builder ignoreCase(boolean val)
Specifies whether to ignore case when matching and returns Builder object.- Parameters:
val
- whether to ignore case when matching.- Returns:
- Builder object.
-
suppressor
public DetectorOptions.Builder suppressor(MatchSuppressor val)
Specifies the suppressor to use and returns Builder object.- Parameters:
val
- the suppressor to use.- Returns:
- current instance
-
build
public DetectorOptions build()
Returns new DetectorOptions instance.- Returns:
- DetectorOptions instance.
-
createPattern
private Pattern createPattern(String formatValue)
Creates pattern to use by DetectorOptions instance.- Parameters:
formatValue
- the format to use.- Returns:
- Pattern object.
-
-