Package com.onwbp.base.text
Class Severity
java.lang.Object
com.onwbp.base.text.Severity
This enumeration class defines the possible severity levels of user messages.
- See Also:
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Map<Severity,
UserMessage> Returns a map from the available severities to their corresponding user message.getLabel()
boolean
isEqualOrMoreSevereThan
(Severity anotherSeverity) Returnstrue
if this severity level is equal to or higher than the one specified.boolean
isError()
boolean
isFatal()
boolean
isInfo()
boolean
static Severity
Returns the severity instance corresponding to the flag specified.static Severity
parseLabel
(String aLabel) Returns the severity instance that corresponds with the label specified.Returns a flag identifying the severity.toString()
-
Field Details
-
FATAL
Specifies a "fatal" error, the highest severity. -
ERROR
Specifies an error. -
WARNING
Specifies a warning. -
INFO
Specifies an information message, the lowest severity.
-
-
Method Details
-
parseFlag
Returns the severity instance corresponding to the flag specified. The flag should have been generated by methodtoParsableString()
.- Throws:
IllegalArgumentException
- if aFlag does not have the format expected, or if it is not recognized.
-
parseLabel
Returns the severity instance that corresponds with the label specified. The label should have been generated by methodgetLabel()
.- Throws:
IllegalArgumentException
- if aLabel is not recognized.
-
getLabel
-
toParsableString
Returns a flag identifying the severity. The returned string can be converted back into aSeverity
instance using methodparseFlag(String)
. -
toString
-
isFatal
public boolean isFatal() -
isError
public boolean isError() -
isWarning
public boolean isWarning() -
isInfo
public boolean isInfo() -
isEqualOrMoreSevereThan
Returnstrue
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
-
getAllSeveritiesWithLabel
Returns a map from the available severities to their corresponding user message.
-