public class AylaDatapoint<T>
extends java.lang.Object
AylaProperty
. Each AylaProperty
contains a set of AylaDatapoints which is essentially a history of values set on
the property.
Creating an AylaDatapoint for a property may be done via a call to AylaProperty.createDatapoint(T, java.util.Map<java.lang.String, java.lang.String>, com.android.volley.Response.Listener<com.aylanetworks.aylasdk.AylaDatapoint<T>>, com.aylanetworks.aylasdk.error.ErrorListener)
. The latest datapoint's value for a given property will be set
as the property's value, and is obtainable via a call to AylaProperty.getValue()
.
A history of datapoints may be fetched from the service by calling AylaProperty.fetchDatapoints(int, java.util.Date, java.util.Date, com.android.volley.Response.Listener<com.aylanetworks.aylasdk.AylaDatapoint[]>, com.aylanetworks.aylasdk.error.ErrorListener)
.
Modifier and Type | Class and Description |
---|---|
static class |
AylaDatapoint.Wrapper<T> |
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
createdAt |
protected java.lang.String |
createdAtFromDevice |
protected boolean |
echo |
protected java.util.Map<java.lang.String,java.lang.String> |
metadata |
protected java.lang.String |
updatedAt |
protected T |
value |
Modifier | Constructor and Description |
---|---|
protected |
AylaDatapoint() |
|
AylaDatapoint(CreateDatapointCommand<T> command) |
|
AylaDatapoint(T value)
Creates an AylaDatapoint with a specific value
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAckedAt() |
int |
getAckMessage() |
int |
getAckStatus() |
java.util.Date |
getCreatedAt() |
java.util.Date |
getCreatedAtFromDevice() |
java.util.Map<java.lang.String,java.lang.String> |
getMetadata() |
java.util.Date |
getUpdatedAt() |
java.lang.String |
getUpdatedAtString() |
T |
getValue() |
boolean |
isEcho()
Echo is an indication of the source, set by the device for ToDevice properties.
|
void |
setValue(T value) |
Change |
updateFrom(AylaDatapoint other)
Called internally by the SDK, this method updates a datapoint with values from another
datapoint and notifies the device's listeners of a change.
|
@Expose protected java.lang.String createdAt
@Expose protected java.lang.String createdAtFromDevice
@Expose protected boolean echo
@Expose protected java.util.Map<java.lang.String,java.lang.String> metadata
@Expose protected java.lang.String updatedAt
@Expose protected T value
protected AylaDatapoint()
public AylaDatapoint(CreateDatapointCommand<T> command)
public AylaDatapoint(T value)
value
- Value to assign to the datapointpublic int getAckStatus()
public int getAckMessage()
public java.lang.String getAckedAt()
public java.util.Date getCreatedAt()
public java.util.Date getCreatedAtFromDevice()
public boolean isEcho()
public java.util.Map<java.lang.String,java.lang.String> getMetadata()
public java.util.Date getUpdatedAt()
public java.lang.String getUpdatedAtString()
public T getValue()
public void setValue(T value)
public Change updateFrom(AylaDatapoint other)
other
- The datapoint used as the source of this update