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
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.maven.api.services.ProblemCollector
ProblemCollector.Impl<P extends BuilderProblem>
-
Method Summary
Modifier and TypeMethodDescriptionproblems
(BuilderProblem.Severity severity) Returns all reported and preserved problems for given severity.boolean
Returnstrue
if reported problem count exceeded allowed count, and issues were lost.int
problemsReportedFor
(BuilderProblem.Severity... severity) Returns count of problems reported for given severities.boolean
reportProblem
(P problem) Reports a problem: always maintains the counters, but whether problem is preserved in memory, depends on implementation and its configuration.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.maven.api.services.ProblemCollector
hasErrorProblems, hasFatalProblems, hasProblemsFor, hasWarningProblems, problems, totalProblemsReported
-
Method Details
-
problemsReportedFor
Description copied from interface:ProblemCollector
Returns count of problems reported for given severities.- Specified by:
problemsReportedFor
in interfaceProblemCollector<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
Returnstrue
if reported problem count exceeded allowed count, and issues were lost. When this method returnstrue
, it means that element count of stream returned by methodProblemCollector.problems()
and the counter returned byProblemCollector.totalProblemsReported()
are not equal (latter is bigger than former).- Specified by:
problemsOverflow
in interfaceProblemCollector<P extends BuilderProblem>
- Returns:
- true if the problem collector has overflowed and some problems were not preserved
-
reportProblem
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 interfaceProblemCollector<P extends BuilderProblem>
- Parameters:
problem
- the problem to report- Returns:
true
if passed problem is preserved by this call.
-
problems
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 interfaceProblemCollector<P extends BuilderProblem>
- Parameters:
severity
- the severity level to get problems for- Returns:
- a stream of problems with the specified severity
-