public class Data extends Object implements Comparable<Data>
Data has an Id and a timestamp. The
timestamp is used to ensure that data is time-ordered when being sent into the alerting engine. If
not assigned the timestamp will be assigned to current time.| Modifier and Type | Field and Description |
|---|---|
protected Map<String,String> |
context
Optional, non-evaluated contextual data to be kept with the datum
|
protected String |
id |
protected long |
timestamp |
protected String |
value
For single-value condition types.
|
| Constructor and Description |
|---|
Data() |
Data(String id,
long timestamp,
Map<String,String> values)
Construct a multi-value datum with no context data.
|
Data(String id,
long timestamp,
Map<String,String> values,
Map<String,String> context)
Construct a multi-value datum with no context data.
|
Data(String id,
long timestamp,
String value)
Construct a single-value datum with no context data.
|
Data(String id,
long timestamp,
String value,
Map<String,String> context)
Construct a single-value datum with no context data.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addProperty(String name,
String value) |
int |
compareTo(Data o) |
boolean |
equals(Object obj) |
static Data |
forAvailability(String id,
long timestamp,
AvailabilityType value) |
static Data |
forAvailability(String id,
long timestamp,
AvailabilityType value,
Map<String,String> context) |
static Data |
forNumeric(String id,
long timestamp,
Double value) |
static Data |
forNumeric(String id,
long timestamp,
Double value,
Map<String,String> context) |
Map<String,String> |
getContext() |
String |
getId() |
long |
getTimestamp() |
String |
getValue() |
int |
hashCode() |
void |
setContext(Map<String,String> context) |
void |
setId(String id) |
void |
setTimestamp(long timestamp) |
void |
setValue(String value) |
String |
toString() |
protected String id
protected long timestamp
protected String value
public Data()
public Data(String id, long timestamp, String value)
id - not nulltimestamp - in millis, if less than 1 assigned currentTime.value - the valuepublic Data(String id, long timestamp, String value, Map<String,String> context)
id - not nulltimestamp - in millis, if less than 1 assigned currentTime.value - the valuecontext - optional, contextual name-value pairs to be stored with the data.public Data(String id, long timestamp, Map<String,String> values)
id - not nulltimestamp - in millis, if less than 1 assigned currentTime.values - the valuespublic Data(String id, long timestamp, Map<String,String> values, Map<String,String> context)
id - not nulltimestamp - in millis, if less than 1 assigned currentTime.values - the valuescontext - optional, contextual name-value pairs to be stored with the data.public static Data forNumeric(String id, long timestamp, Double value, Map<String,String> context)
public static Data forAvailability(String id, long timestamp, AvailabilityType value)
public static Data forAvailability(String id, long timestamp, AvailabilityType value, Map<String,String> context)
public String getId()
public void setId(String id)
public long getTimestamp()
public void setTimestamp(long timestamp)
timestamp - in millis, if less than 1 assigned currentTime.public String getValue()
public void setValue(String value)
public int compareTo(Data o)
compareTo in interface Comparable<Data>Copyright © 2015 Red Hat, Inc.. All rights reserved.