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()
SensorEvent
Sensor
data.getValue
in interface SensorEvent<T>
public Sensor<T> getSensor()
SensorEvent
Sensor
describing the data.getSensor
in interface SensorEvent<T>
public Entity getSource()
SensorEvent
Entity
where the data originated.getSource
in interface SensorEvent<T>
public long getTimestamp()
SensorEvent
System.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.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object