@Incubating public interface ProblemSpec
Problem
instance builder that is not capable of creating a new instances.
An example of how to use the builder:
<problemReporter>.report(configurator -> configurator
.label("test problem")
.category("category", "subcategory")
.severity(Severity.ERROR)
.details("this is a test")
Modifier and Type | Method | Description |
---|---|---|
ProblemSpec |
additionalData(java.lang.String key,
java.lang.Object value) |
Specifies arbitrary data associated with this problem.
|
ProblemSpec |
category(java.lang.String category,
java.lang.String... details) |
Declares the problem category.
|
ProblemSpec |
details(java.lang.String details) |
The long description of this problem.
|
ProblemSpec |
documentedAt(java.lang.String url) |
Declares the documentation for this problem.
|
ProblemSpec |
documentedAt(DocLink doc) |
Declares the documentation for this problem.
|
ProblemSpec |
fileLocation(java.lang.String path,
java.lang.Integer line,
java.lang.Integer column,
java.lang.Integer length) |
Declares that this problem is in a file with optional position and length.
|
ProblemSpec |
label(java.lang.String label,
java.lang.Object... args) |
Declares a short message for this problem.
|
ProblemSpec |
pluginLocation(java.lang.String pluginId) |
Declares that this problem is emitted while applying a plugin.
|
ProblemSpec |
severity(Severity severity) |
Declares the severity of the problem.
|
ProblemSpec |
solution(java.lang.String solution) |
The description of how to solve this problem.
|
ProblemSpec |
stackLocation() |
Declares that this problem should automatically collect the location information based on the current stack trace.
|
ProblemSpec |
withException(java.lang.RuntimeException e) |
The exception causing this problem.
|
ProblemSpec label(java.lang.String label, java.lang.Object... args)
label
- the short messageargs
- the arguments for formatting the label with String.format(String, Object...)
ProblemSpec category(java.lang.String category, java.lang.String... details)
category
- the type namedetails
- the type detailsProblemCategory
ProblemSpec documentedAt(DocLink doc)
ProblemSpec documentedAt(java.lang.String url)
ProblemSpec fileLocation(java.lang.String path, @Nullable java.lang.Integer line, @Nullable java.lang.Integer column, @Nullable java.lang.Integer length)
path
- the file locationline
- the line numbercolumn
- the column numberlength
- the length of the textProblemSpec pluginLocation(java.lang.String pluginId)
pluginId
- the ID of the applied pluginProblemSpec stackLocation()
ProblemSpec details(java.lang.String details)
details
- the detailsProblemSpec solution(java.lang.String solution)
solution
- the solution.ProblemSpec additionalData(java.lang.String key, java.lang.Object value)
The only supported value type is String
. Future Gradle versions may support additional types.
java.lang.RuntimeException
- for null values and for values with unsupported type.ProblemSpec withException(java.lang.RuntimeException e)
e
- the exception.ProblemSpec severity(Severity severity)
severity
- the severity