public class BasicSensorEvent<T> extends java.lang.Object implements SensorEvent<T>
| Constructor and Description |
|---|
BasicSensorEvent(Sensor<T> sensor,
Entity source,
T value)
arguments should not be null (except in certain limited testing situations)
|
BasicSensorEvent(Sensor<T> sensor,
Entity source,
T value,
long timestamp) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o)
Any SensorEvents are equal if their sensor, source and value are equal.
|
Sensor<T> |
getSensor()
The
Sensor describing the data. |
Entity |
getSource()
The
Entity where the data originated. |
long |
getTimestamp()
The time this data was published, as a UTC time in milliseconds (e.g.
|
T |
getValue()
The value for the
Sensor data. |
int |
hashCode() |
static <T> SensorEvent<T> |
of(Sensor<T> sensor,
Entity source,
T value) |
static <T> SensorEvent<T> |
of(Sensor<T> sensor,
Entity source,
T value,
long timestamp) |
static <T> SensorEvent<T> |
ofUnchecked(Sensor<T> sensor,
Entity source,
java.lang.Object value) |
static <T> SensorEvent<T> |
ofUnchecked(Sensor<T> sensor,
Entity source,
java.lang.Object value,
long timestamp) |
java.lang.String |
toString() |
public BasicSensorEvent(Sensor<T> sensor, Entity source, T value)
public T getValue()
SensorEventSensor data.getValue in interface SensorEvent<T>public Sensor<T> getSensor()
SensorEventSensor describing the data.getSensor in interface SensorEvent<T>public Entity getSource()
SensorEventEntity where the data originated.getSource in interface SensorEvent<T>public long getTimestamp()
SensorEventSystem.currentTimeMillis().getTimestamp in interface SensorEvent<T>public static <T> SensorEvent<T> of(Sensor<T> sensor, Entity source, T value, long timestamp)
public static <T> SensorEvent<T> ofUnchecked(Sensor<T> sensor, Entity source, java.lang.Object value, long timestamp)
public static <T> SensorEvent<T> of(Sensor<T> sensor, Entity source, T value)
public static <T> SensorEvent<T> ofUnchecked(Sensor<T> sensor, Entity source, java.lang.Object value)
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object