public enum Severity extends Enum<Severity>
ValidationMessage
.
Useful to categorize validation results, for example to prevent an object
from being saved if the primary key is missing.
The severity is used in almost all views that present validation messages
and is used in operations on instances of
ValidationResult
.
ValidationMessage
,
ValidationResult
Enum Constant and Description |
---|
ERROR
Indicates a problem that cannot be resumed or worked around.
|
OK
Returned by empty validation results to indicate that
no problem has been detected, or in other words, everything is fine.
|
WARNING
Indicates a problem that can be resumed or handled in
a reasonable way.
|
Modifier and Type | Method and Description |
---|---|
static Severity |
max(Severity severity1,
Severity severity2)
Returns the higher of the given severities by comparing their ordinals.
|
static Severity |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Severity[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Severity ERROR
public static final Severity WARNING
public static final Severity OK
public static Severity[] values()
for (Severity c : Severity.values()) System.out.println(c);
public static Severity valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant
with the specified nameNullPointerException
- if the argument is nullpublic static Severity max(Severity severity1, Severity severity2)
severity1
- the first severity to checkseverity2
- the second severity to checkCopyright © 2003-2011 JGoodies Karsten Lentzsch. All Rights Reserved.