public class AlarmData extends FunctionData
FunctionData value.Alarm,
FunctionData| Modifier and Type | Field and Description |
|---|---|
static String |
FIELD_SEVERITY
Represents the severity field name.
|
static String |
FIELD_TYPE
Represents the type field name.
|
static int |
SEVERITY_CRITICAL
The severity rating indicates that there a critical alarm.
|
static int |
SEVERITY_MAJOR
The severity rating indicates that there is a major alarm.
|
static int |
SEVERITY_MINOR
The severity rating indicates that there is a minor alarm.
|
static int |
SEVERITY_UNDEFINED
The severity constant indicates that there is no severity rating for this
alarm.
|
static int |
TYPE_ACCESS_CONTROL
The alarm type indicates that there is access control issue.
|
static int |
TYPE_BURGLAR
The alarm type indicates that there is a burglar notification.
|
static int |
TYPE_COLD
The alarm type indicates that temperature is too low.
|
static int |
TYPE_GAS_CO
The alarm type indicates that carbon monoxide (CO) is detected.
|
static int |
TYPE_GAS_CO2
The alarm type indicates that carbon dioxide (CO2) is detected.
|
static int |
TYPE_HARDWARE_FAIL
The alarm type indicates that there is hardware failure.
|
static int |
TYPE_HEAT
The alarm type indicates that temperature is too high.
|
static int |
TYPE_POWER_FAIL
The alarm type indicates a power cut.
|
static int |
TYPE_SMOKE
The alarm type indicates that smoke is detected.
|
static int |
TYPE_SOFTWARE_FAIL
The alarm type indicates that there is software failure.
|
static int |
TYPE_TAMPER
The alarm type for a tamper indication.
|
static int |
TYPE_UNDEFINED
The alarm type indicates that the type is not specified.
|
static int |
TYPE_WATER
The alarm type indicates that a water leak is detected.
|
DESCRIPTION, FIELD_METADATA, FIELD_TIMESTAMP| Constructor and Description |
|---|
AlarmData(long timestamp,
Map<String,?> metadata,
int severity,
int type)
Constructs new
AlarmData instance with the specified arguments. |
AlarmData(Map<String,?> fields)
Constructs new
AlarmData instance with the specified field
values. |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Object o)
Compares this
AlarmData instance with the given argument. |
boolean |
equals(Object o)
Two
AlarmData instances are equal if they contain equal metadata,
timestamp, type and severity. |
int |
getSeverity()
Returns the alarm severity.
|
int |
getType()
Returns the alarm type.
|
int |
hashCode()
Returns the hash code for this
AlarmData object. |
String |
toString()
Returns the string representation of this alarm data.
|
getMetadata, getTimestamppublic static final String FIELD_SEVERITY
getSeverity(). The field type is int. The constant can
be used as a key to AlarmData(Map) .public static final String FIELD_TYPE
getType(). The field type is int. The constant can be
used as a key to AlarmData(Map).public static final int TYPE_UNDEFINED
public static final int TYPE_ACCESS_CONTROL
public static final int TYPE_BURGLAR
public static final int TYPE_COLD
public static final int TYPE_GAS_CO
public static final int TYPE_GAS_CO2
public static final int TYPE_HEAT
public static final int TYPE_HARDWARE_FAIL
public static final int TYPE_POWER_FAIL
public static final int TYPE_SMOKE
public static final int TYPE_SOFTWARE_FAIL
public static final int TYPE_TAMPER
public static final int TYPE_WATER
public static final int SEVERITY_UNDEFINED
public static final int SEVERITY_MINOR
SEVERITY_MAJOR and
SEVERITY_CRITICAL.public static final int SEVERITY_MAJOR
SEVERITY_MINOR and lower than
SEVERITY_CRITICAL.public static final int SEVERITY_CRITICAL
SEVERITY_MINOR and
SEVERITY_MAJOR.public AlarmData(Map<String,?> fields)
AlarmData instance with the specified field
values. The map keys must match to the field names. The map values will
be assigned to the appropriate class fields. For example, the maps can
be: {"severity"=Integer(1)...}. That map will initialize the
FIELD_SEVERITY field with 1. If severity is missing,
SEVERITY_UNDEFINED is used.
FIELD_SEVERITY - optional field. The value type must be
Integer.FIELD_TYPE - optional field. The value type must be
Integer.fields - Contains the new AlarmData instance field values.ClassCastException - If the field value types are not expected.IllegalArgumentException - If the alarm severity is invalid.NullPointerException - If the fields map is null.public AlarmData(long timestamp,
Map<String,?> metadata,
int severity,
int type)
AlarmData instance with the specified arguments.timestamp - The alarm data timestamp optional field.metadata - The alarm data metadata optional field.severity - The alarm data severity optional field.type - The alarm data type optional field.IllegalArgumentException - If the alarm severity is invalid.public int getType()
public int getSeverity()
public boolean equals(Object o)
AlarmData instances are equal if they contain equal metadata,
timestamp, type and severity.equals in class FunctionDatao - The object to compare this data.true if this object is equivalent to the specified one.FunctionData.equals(java.lang.Object)public int hashCode()
AlarmData object. The hash code is
a sum of FunctionData.hashCode(), the alarm severity and the
alarm type.hashCode in class FunctionDataAlarmData object.FunctionData.hashCode()public int compareTo(Object o)
AlarmData instance with the given argument. If the
argument is not AlarmData, it throws ClassCastException.
Otherwise, this method returns:
-1 if this instance field is less than a field of the
specified argument.0 if all fields are equivalent.1 if this instance field is greater than a field of the
specified argument.compareTo in interface Comparable<Object>compareTo in class FunctionDatao - AlarmData to be compared.-1, 0 or 1 depending on the comparison
rules.ClassCastException - If the method argument is not of type
AlarmData.Comparable.compareTo(java.lang.Object)Copyright © Contributors to the Eclipse Foundation Licensed under the Eclipse Foundation Specification License – v1.0