Class ProblemCollector.Impl<P extends BuilderProblem>

java.lang.Object
org.apache.maven.api.services.ProblemCollector.Impl<P>
Type Parameters:
P - the type of problem
All Implemented Interfaces:
ProblemCollector<P>
Enclosing interface:
ProblemCollector<P extends BuilderProblem>

public static class ProblemCollector.Impl<P extends BuilderProblem> extends Object implements ProblemCollector<P>
Default implementation of the ProblemCollector interface.
Since:
4.0.0
  • Method Details

    • problemsReportedFor

      public int problemsReportedFor(BuilderProblem.Severity... severity)
      Description copied from interface: ProblemCollector
      Returns count of problems reported for given severities.
      Specified by:
      problemsReportedFor in interface ProblemCollector<P extends BuilderProblem>
      Parameters:
      severity - the severity levels to count problems for
      Returns:
      the total count of problems for the specified severities
    • problemsOverflow

      public boolean problemsOverflow()
      Description copied from interface: ProblemCollector
      Returns true if reported problem count exceeded allowed count, and issues were lost. When this method returns true, it means that element count of stream returned by method ProblemCollector.problems() and the counter returned by ProblemCollector.totalProblemsReported() are not equal (latter is bigger than former).
      Specified by:
      problemsOverflow in interface ProblemCollector<P extends BuilderProblem>
      Returns:
      true if the problem collector has overflowed and some problems were not preserved
    • reportProblem

      public boolean reportProblem(P problem)
      Description copied from interface: ProblemCollector
      Reports a problem: always maintains the counters, but whether problem is preserved in memory, depends on implementation and its configuration.
      Specified by:
      reportProblem in interface ProblemCollector<P extends BuilderProblem>
      Parameters:
      problem - the problem to report
      Returns:
      true if passed problem is preserved by this call.
    • problems

      public Stream<P> problems(BuilderProblem.Severity severity)
      Description copied from interface: ProblemCollector
      Returns all reported and preserved problems for given severity. Note: counters and element count in this stream does not have to be equal.
      Specified by:
      problems in interface ProblemCollector<P extends BuilderProblem>
      Parameters:
      severity - the severity level to get problems for
      Returns:
      a stream of problems with the specified severity