public final class AlarmLevel extends Object implements Serializable
A singleton instance of each enumerated value is guaranteed (via an implementation
of readResolve()
- refer java.io.Serializable
),
so that equality tests using ==
are always evaluated correctly. (This
equality test is only guaranteed if this class is loaded in the application's boot class
path, rather than dynamically loaded at runtime.)
The alarm levels, in order of relative severity, are:
Modifier and Type | Field and Description |
---|---|
static AlarmLevel |
CLEAR
Alarm level used when an error condition has cleared.
|
static String |
CLEAR_STRING
A string representation of
CLEAR . |
static AlarmLevel |
CRITICAL
Alarm level used for critical error conditions.
|
static String |
CRITICAL_STRING
A string representation of
CRITICAL . |
static AlarmLevel |
INDETERMINATE
Alarm level used when the severity of the error condition is unknown.
|
static String |
INDETERMINATE_STRING
A string representation of
INDETERMINATE . |
static int |
LEVEL_CLEAR
An integer representation of
CLEAR . |
static int |
LEVEL_CRITICAL
An integer representation of
CRITICAL . |
static int |
LEVEL_INDETERMINATE
An integer representation of
INDETERMINATE . |
static int |
LEVEL_MAJOR
An integer representation of
MAJOR . |
static int |
LEVEL_MINOR
An integer representation of
MINOR . |
static int |
LEVEL_WARNING
An integer representation of
WARNING . |
static AlarmLevel |
MAJOR
Alarm level used for error conditions of major severity.
|
static String |
MAJOR_STRING
A string representation of
MAJOR . |
static AlarmLevel |
MINOR
Alarm level used for error conditions of minor severity.
|
static String |
MINOR_STRING
A string representation of
MINOR . |
static AlarmLevel |
WARNING
Alarm level used to indicate alarm warning conditions.
|
static String |
WARNING_STRING
A string representation of
WARNING . |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Compare this alarm level for equality with another.
|
static AlarmLevel |
fromInt(int level)
Get an
AlarmLevel object from an integer value. |
static AlarmLevel |
fromString(String level)
Get an
AlarmLevel object from a string value. |
int |
hashCode()
Get a hash code value for this alarm level.
|
boolean |
isClear()
Determine if this AlarmLevel object represents the CLEAR alarm level.
|
boolean |
isCritical()
Determine if this AlarmLevel object represents the CRITICAL alarm level.
|
boolean |
isHigherLevel(AlarmLevel other)
Determine if this AlarmLevel object represents a level that is higher than some other
AlarmLevel object.
|
boolean |
isIndeterminate()
Determine if this AlarmLevel object represents the INDETERMINATE alarm level.
|
boolean |
isMajor()
Determine if this AlarmLevel object represents the MAJOR alarm level.
|
boolean |
isMinor()
Determine if this AlarmLevel object represents the MINOR alarm level.
|
boolean |
isWarning()
Determine if this AlarmLevel object represents the WARNING alarm level.
|
int |
toInt()
Get an integer value representation for this
AlarmLevel object. |
String |
toString()
Get the textual representation of this alarm level object.
|
public static final int LEVEL_CLEAR
CLEAR
.public static final int LEVEL_CRITICAL
CRITICAL
.public static final int LEVEL_MAJOR
MAJOR
.public static final int LEVEL_WARNING
WARNING
.public static final int LEVEL_INDETERMINATE
INDETERMINATE
.public static final int LEVEL_MINOR
MINOR
.public static final String CLEAR_STRING
CLEAR
.public static final String CRITICAL_STRING
CRITICAL
.public static final String MAJOR_STRING
MAJOR
.public static final String WARNING_STRING
WARNING
.public static final String INDETERMINATE_STRING
INDETERMINATE
.public static final String MINOR_STRING
MINOR
.public static final AlarmLevel CLEAR
public static final AlarmLevel CRITICAL
public static final AlarmLevel MAJOR
public static final AlarmLevel WARNING
public static final AlarmLevel INDETERMINATE
public static final AlarmLevel MINOR
public static AlarmLevel fromInt(int level) throws IllegalArgumentException
AlarmLevel
object from an integer value.level
- the level as an integer.AlarmLevel
object corresponding to level
.IllegalArgumentException
- if level
is not a valid alarm
level value.public static AlarmLevel fromString(String level) throws NullPointerException, IllegalArgumentException
AlarmLevel
object from a string value.level
- the level as a string, for example as returned by the toString()
method (case insensitive).AlarmLevel
object corresponding to level
.NullPointerException
- if level
is null
.IllegalArgumentException
- if level
is not a valid alarm
level string.public int toInt()
AlarmLevel
object.AlarmLevel
object.public boolean isClear()
This method is effectively equivalent to the conditional test:
(this == CLEAR)
, ie. the code:
if (alarmLevel.isClear()) ...
is interchangeable with the code:
if (alarmLevel == AlarmLevel.CLEAR) ...
true
if this object represents the CLEAR alarm level,
false
otherwise.public boolean isCritical()
This method is effectively equivalent to the conditional test:
(this == CRITICAL)
, ie. the code:
if (alarmLevel.isCritical()) ...
is interchangeable with the code:
if (alarmLevel == AlarmLevel.CRITICAL) ...
true
if this object represents the CRITICAL alarm level,
false
otherwise.public boolean isMajor()
This method is effectively equivalent to the conditional test:
(this == MAJOR)
, ie. the code:
if (alarmLevel.isMajor()) ...
is interchangeable with the code:
if (alarmLevel == AlarmLevel.MAJOR) ...
true
if this object represents the MAJOR alarm level,
false
otherwise.public boolean isWarning()
This method is effectively equivalent to the conditional test:
(this == WARNING)
, ie. the code:
if (alarmLevel.isWarning()) ...
is interchangeable with the code:
if (alarmLevel == AlarmLevel.WARNING) ...
true
if this object represents the WARNING alarm level,
false
otherwise.public boolean isIndeterminate()
This method is effectively equivalent to the conditional test:
(this == INDETERMINATE)
, ie. the code:
if (alarmLevel.isIndeterminate()) ...
is interchangeable with the code:
if (alarmLevel == AlarmLevel.INDETERMINATE) ...
true
if this object represents the INDETERMINATE alarm level,
false
otherwise.public boolean isMinor()
This method is effectively equivalent to the conditional test:
(this == MINOR)
, ie. the code:
if (alarmLevel.isMinor()) ...
is interchangeable with the code:
if (alarmLevel == AlarmLevel.MINOR) ...
true
if this object represents the MINOR alarm level,
false
otherwise.public boolean isHigherLevel(AlarmLevel other) throws NullPointerException
other
- the AlarmLevel
object to compare this with.true
if the level represented by this AlarmLevel
object is considered a higher level than the level represented by the specified
AlarmLevel
object, false
otherwise.NullPointerException
- if other
is null
.public boolean equals(Object obj)
public int hashCode()