Class AlertSeverity
- All Implemented Interfaces:
Serializable
The levels in descending order are:
- SEVERE (highest value)
- WARNING
- INFO (lowest value)
- Since:
- 8.0
- Author:
- Moran Avigdor
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final AlertSeverityINFO is an alert severity indicating an informational alert.static final AlertSeveritySEVERE is an alert severity indicating a serious failure/situation.static final AlertSeverityWARNING is an alert severity indicating a potential problem. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAlertSeverity(String name, int value) Create a named alert severity with a given integer value. -
Method Summary
Modifier and TypeMethodDescriptionbooleanCompare two objects for value equality.getName()Return the string name of the alert severity.intgetValue()Get the integer value for this alert severity.inthashCode()Generate a hashcode.booleanisInfo()booleanisSevere()booleanstatic AlertSeverityparse(int value) Returns an AlertSeverity by it's value (seegetValue()).static AlertSeverityReturns an AlertSeverity by it's name (seegetName()).final StringtoString()
-
Field Details
-
SEVERE
SEVERE is an alert severity indicating a serious failure/situation.SEVERE alerts should describe events that are of considerable importance and which will prevent normal program execution. They should be reasonably intelligible to end users and to system administrators.
This severity is initialized to
1000. -
WARNING
WARNING is an alert severity indicating a potential problem.WARNING alerts should describe events that will be of interest to end users or system managers, or which indicate potential problems.
This severity is initialized to
900. -
INFO
INFO is an alert severity indicating an informational alert.INFO severity will typically be used when 'resolving' an alert, for which it's previous severity is either unknown or unimportant.
This severity is initialized to
800.
-
-
Constructor Details
-
AlertSeverity
Create a named alert severity with a given integer value.Note that this constructor is "protected" to allow subclassing. In general it is sufficient to use one of the constant Level objects such as
WARNINGorSEVERE. However, if there is a need to add a new alert severity, this call may be subclassed and new constants can be defined.- Parameters:
name- the name of the alert severity, for example "SEVERE".value- an integer value for the severity.
-
-
Method Details
-
getName
Return the string name of the alert severity.- Returns:
- name of this alert severity.
-
getValue
public int getValue()Get the integer value for this alert severity. This integer value can be used for efficient ordering comparisons between alert severity objects.- Returns:
- the integer value for this alert severity.
-
isSevere
public boolean isSevere()- Returns:
trueif this is aSEVEREalert severity.
-
isWarning
public boolean isWarning()- Returns:
trueif this is aWARNINGalert severity.
-
isInfo
public boolean isInfo()- Returns:
trueif this is anINFOalert severity.
-
parse
Returns an AlertSeverity by it's name (seegetName()).- Parameters:
name- representing this severity.- Returns:
- a severity.
- Throws:
IllegalArgumentException- if an unknown severity was requested.
-
parse
Returns an AlertSeverity by it's value (seegetValue()).- Parameters:
value- representing this severity.- Returns:
- a severity.
- Throws:
IllegalArgumentException- if an unknown severity was requested.
-
equals
Compare two objects for value equality. -
hashCode
public int hashCode()Generate a hashcode. -
toString
-