@Incubating public interface ProblemBuilder
Problem
instance builder allowing the specification of all optional fields.
This is the last interface in the builder chain. The order of steps can be traced from the Problems
service interface.
An example of how to use the builder:
<problemService>.createProblemBuilder()
.label("test problem")
.undocumented()
.noLocation()
.type(ValidationProblemId.TEST_PROBLEM.name())
.group(ProblemGroup.TYPE_VALIDATION)
.severity(Severity.ERROR)
.details("this is a test")
Modifier and Type | Method | Description |
---|---|---|
ProblemBuilder |
additionalData(java.lang.String key,
java.lang.String value) |
Specifies arbitrary data associated with this problem.
|
ReportableProblem |
build() |
Creates the new problem.
|
ProblemBuilder |
details(java.lang.String details) |
The long description of this problem.
|
ProblemBuilder |
severity(Severity severity) |
Declares the severity of the problem.
|
ProblemBuilder |
solution(java.lang.String solution) |
The description of how to solve this problem
|
ProblemBuilder |
withException(java.lang.RuntimeException e) |
The exception causing this problem.
|
ProblemBuilder details(java.lang.String details)
details
- the detailsProblemBuilder solution(java.lang.String solution)
solution
- the solution.ProblemBuilder additionalData(java.lang.String key, java.lang.String value)
ProblemBuilder withException(java.lang.RuntimeException e)
e
- the exception.ProblemBuilder severity(Severity severity)
severity
- the severityReportableProblem build()
build()
won't report the problem via build operations, it can be done separately by calling ReportableProblem.report()
.