Schnittstelle ProblemReporter


@Incubating public interface ProblemReporter
Defines different ways to report problems.
Seit:
8.6
  • Methodendetails

    • create

      Problem create(ProblemId problemId, Action<? super ProblemSpec> action)
      Creates a new problem without reporting it immediately. The created problem can be later reported with report(Problem).
      Parameter:
      problemId - The problem id
      action - The problem configuration.
      Gibt zurück:
      The new problem.
      Seit:
      8.13
    • report

      void report(ProblemId problemId, Action<? super ProblemSpec> spec)
      Configures and reports a new problem.

      The spec must specify the problem label and the category. Any additional configuration is optional.

      Parameter:
      problemId - the problem id
      spec - the problem configuration
      Seit:
      8.13
    • report

      void report(Problem problem)
      Reports the target problem.
      Parameter:
      problem - The problem to report.
      Seit:
      8.13
    • report

      void report(Collection<? extends Problem> problems)
      Reports the target problems.
      Parameter:
      problems - The problems to report.
      Seit:
      8.13
    • throwing

      RuntimeException throwing(Throwable exception, ProblemId problemId, Action<? super ProblemSpec> spec)
      Configures a new problem, reports it, and uses it to throw a new exception.

      An exception must be provided in the spec.

      The spec must specify the exception, the problem label, and the category. Any additional configuration is optional.

      Parameter:
      exception - the exception to throw after reporting the problems
      problemId - the problem id
      spec - the problem configuration
      Gibt zurück:
      never returns by throwing the exception, but using throw statement at the call site is encouraged to indicate the intent and benefit from local control flow.
      Seit:
      8.13
    • throwing

      RuntimeException throwing(Throwable exception, Problem problem)
      Configures a new problem, reports it, and uses it to throw a new exception.

      An exception must be provided in the spec.

      The spec must specify the exception, the problem label, and the category. Any additional configuration is optional.

      Parameter:
      exception - the exception to throw after reporting the problems
      problem - the problem to report
      Gibt zurück:
      never returns by throwing the exception, but using throw statement at the call site is encouraged to indicate the intent and benefit from local control flow.
      Seit:
      8.13
    • throwing

      RuntimeException throwing(Throwable exception, Collection<? extends Problem> problems)
      Reports the target problems and throws a runtime exception. When this method is used, all reported problems will be associated with the thrown exception.
      Parameter:
      exception - the exception to throw after reporting the problems
      problems - the problems to report
      Gibt zurück:
      nothing, the method throws an exception
      Seit:
      8.13