public final class Severity extends Object
UserMessage
Modifier and Type | Field and Description |
---|---|
static Severity |
ERROR
Specifies an error.
|
static Severity |
FATAL
Specifies a "fatal" error, the highest severity.
|
static Severity |
INFO
Specifies an information message, the lowest severity.
|
static Severity |
WARNING
Specifies a warning.
|
Modifier and Type | Method and Description |
---|---|
static Map<Severity,UserMessage> |
getAllSeveritiesWithLabel()
Returns a map from the available severities to their corresponding user message.
|
String |
getLabel() |
boolean |
isEqualOrMoreSevereThan(Severity anotherSeverity)
Returns
true if this severity level is equal to or higher than the one specified. |
boolean |
isError() |
boolean |
isFatal() |
boolean |
isInfo() |
boolean |
isWarning() |
static Severity |
parseFlag(String aFlag)
Returns the severity instance corresponding to the flag specified.
|
static Severity |
parseLabel(String aLabel)
Returns the severity instance that corresponds with the label specified.
|
String |
toParsableString()
Returns a flag identifying the severity.
|
String |
toString() |
public static final Severity FATAL
public static final Severity ERROR
public static final Severity WARNING
public static final Severity INFO
public static Severity parseFlag(String aFlag) throws IllegalArgumentException
toParsableString()
.IllegalArgumentException
- if aFlag does not have the format expected, or if it is not recognized.public static Severity parseLabel(String aLabel) throws IllegalArgumentException
getLabel()
.IllegalArgumentException
- if aLabel is not recognized.public String getLabel()
public String toParsableString()
Severity
instance
using method parseFlag(String)
.public boolean isFatal()
public boolean isError()
public boolean isWarning()
public boolean isInfo()
public boolean isEqualOrMoreSevereThan(Severity anotherSeverity)
true
if this severity level is equal to or higher than the one specified.
The order of severity levels is as follows:
FATAL > ERROR > WARNING > INFO
public static Map<Severity,UserMessage> getAllSeveritiesWithLabel()