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
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic Map<Severity,UserMessage> Returns a map from the available severities to their corresponding user message.getLabel()booleanisEqualOrMoreSevereThan(Severity anotherSeverity) Returnstrueif this severity level is equal to or higher than the one specified.booleanisError()booleanisFatal()booleanisInfo()booleanstatic SeverityReturns the severity instance corresponding to the flag specified.static SeverityparseLabel(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 aSeverityinstance using methodparseFlag(String). -
toString
-
isFatal
public boolean isFatal() -
isError
public boolean isError() -
isWarning
public boolean isWarning() -
isInfo
public boolean isInfo() -
isEqualOrMoreSevereThan
Returnstrueif 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.
-