Package org.gradle.api.problems

## Interface ProblemBuilder

-     @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")

  Since:
    8.4

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    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.

- - ### Method Detail

    - #### details

          ProblemBuilder details​(java.lang.String details)

      The long description of this problem.
      Parameters:
        `details` - the details
      Returns:
        this

    - #### solution

          ProblemBuilder solution​(java.lang.String solution)

      The description of how to solve this problem
      Parameters:
        `solution` - the solution.
      Returns:
        this

    - #### additionalData

          ProblemBuilder additionalData​(java.lang.String key,
                                        java.lang.String value)

      Specifies arbitrary data associated with this problem.
      Returns:
        this

    - #### withException

          ProblemBuilder withException​(java.lang.RuntimeException e)

      The exception causing this problem.
      Parameters:
        `e` - the exception.
      Returns:
        this

    - #### severity

          ProblemBuilder severity​(Severity severity)

      Declares the severity of the problem.
      Parameters:
        `severity` - the severity
      Returns:
        this

    - #### build

          ReportableProblem build()

      Creates the new problem. Calling `build()` won't report the problem via build operations, it can be done separately by calling `ReportableProblem.report()`.
      Returns:
        the new problem