public final class Problems
extends java.lang.Object
Constructor and Description |
---|
Problems() |
Modifier and Type | Method and Description |
---|---|
void |
add(Problem problem)
Add a problem
|
void |
add(java.lang.String problem)
Convenience method to add a problem with the specified message and
Severity.FATAL
|
void |
add(java.lang.String problem,
Severity severity)
Add a problem with the specified severity
|
java.util.List<? extends Problem> |
allProblems()
Get the entire set of problems, sorted by severity first, order of
addition second.
|
static Problems |
create(java.lang.String message)
Create a new Problems with the initial (fatal) problem.
|
Problem |
getLeadProblem()
Get the
Problem with the highest severity. |
boolean |
hasFatal()
Determine if this set of problems includes any that are fatal.
|
void |
putAll(Problems problems)
Dump all problems in another instance of Problems into this one.
|
java.lang.String |
toString() |
public final void add(java.lang.String problem)
problem
- public final void add(java.lang.String problem, Severity severity)
problem
- the messageseverity
- the severitypublic final void add(Problem problem)
problem
- The problem (may be null)public final void putAll(Problems problems)
problems
- The other problems.public final boolean hasFatal()
public static Problems create(java.lang.String message)
message
- A localized messagepublic final Problem getLeadProblem()
Problem
with the highest severity.
If there is more than one problem with equal severity, the
one first added will be considered more severe.Problem
in this setpublic final java.util.List<? extends Problem> allProblems()
public java.lang.String toString()
toString
in class java.lang.Object