|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jgoodies.validation.Severity
public final class Severity
A typesafe enumeration for the different severities used in instances of
ValidationMessage
. Useful to categorize validation results, for
example to prevent an object from being saved if the primary key is missing.
It is an ordinal-based comparable and serializable enumeration implementation
that is not extensible.
The severity is used in almost all views that present validation messages
and is used in operations on instances of
ValidationResult
.
ValidationMessage
,
ValidationResult
,
Serialized FormField Summary | |
---|---|
static Severity |
ERROR
Indicates a problem that cannot be resumed or worked around. |
static Severity |
OK
Returned by empty validation results to indicate that no problem has been detected, or in other words, everything is fine. |
static Severity |
WARNING
Indicates a problem that can be resumed or handled in a reasonable way. |
Method Summary | |
---|---|
int |
compareTo(Object o)
Compares this object with the specified object for order. |
static Severity |
max(Severity severity1,
Severity severity2)
Returns the higher of the given severities by comparing their ordinals. |
String |
toString()
Returns the name this object's string representation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Severity ERROR
public static final Severity WARNING
public static final Severity OK
Method Detail |
---|
public String toString()
toString
in class Object
public int compareTo(Object o)
This implementation is consistent with #equals
, i. e.
(x.compareTo(y)==0) == (x.equals(y))
.
The implementation is based on the internal ordinal.
compareTo
in interface Comparable
o
- the Object to be compared.
ClassCastException
- if the specified object's type prevents it
from being compared to this Object.public static Severity max(Severity severity1, Severity severity2)
severity1
- the first severity to checkseverity2
- the second severity to check
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |