public class VehicleMessage extends java.lang.Object implements android.os.Parcelable, java.lang.Comparable<VehicleMessage>
Modifier and Type | Class and Description |
---|---|
static interface |
VehicleMessage.Listener |
Modifier and Type | Field and Description |
---|---|
static android.os.Parcelable.Creator<VehicleMessage> |
CREATOR |
static java.lang.String |
EXTRAS_KEY |
Modifier | Constructor and Description |
---|---|
|
VehicleMessage() |
|
VehicleMessage(java.lang.Long timestamp)
Construct a new empty VehicleMessage.
|
|
VehicleMessage(java.lang.Long timestamp,
java.util.Map<java.lang.String,java.lang.Object> extras)
Construct a new VehicleMessage with the given extra data and an
overridden timestamp.
|
|
VehicleMessage(java.util.Map<java.lang.String,java.lang.Object> extras)
Construct a new VehicleMessage with the given extra data.
|
protected |
VehicleMessage(android.os.Parcel in) |
Modifier and Type | Method and Description |
---|---|
CanMessage |
asCanMessage() |
CommandResponse |
asCommandResponse() |
DiagnosticRequest |
asDiagnosticRequest() |
DiagnosticResponse |
asDiagnosticResponse() |
EventedSimpleVehicleMessage |
asEventedMessage() |
KeyedMessage |
asKeyedMessage() |
NamedVehicleMessage |
asNamedMessage() |
SimpleVehicleMessage |
asSimpleMessage() |
int |
compareTo(VehicleMessage other) |
int |
describeContents() |
boolean |
equals(java.lang.Object obj) |
java.util.Date |
getDate() |
java.util.Map<java.lang.String,java.lang.Object> |
getExtras() |
java.lang.Long |
getTimestamp() |
boolean |
hasExtras() |
boolean |
isTimestamped() |
protected void |
readFromParcel(android.os.Parcel in) |
void |
setExtras(java.util.Map<java.lang.String,java.lang.Object> extras) |
void |
setTimestamp(java.lang.Long timestamp)
Override the timestamp of the message.
|
void |
timestamp() |
java.lang.String |
toString() |
void |
untimestamp()
Make the message's timestamp invalid so it won't end up in the
serialized version.
|
void |
writeToParcel(android.os.Parcel out,
int flags) |
public static final java.lang.String EXTRAS_KEY
public static final android.os.Parcelable.Creator<VehicleMessage> CREATOR
public VehicleMessage()
public VehicleMessage(java.lang.Long timestamp)
timestamp
- timestamp as milliseconds since unix epochpublic VehicleMessage(java.lang.Long timestamp, java.util.Map<java.lang.String,java.lang.Object> extras)
public VehicleMessage(java.util.Map<java.lang.String,java.lang.Object> extras)
extras
- A map of any extra data to attach to this message.protected VehicleMessage(android.os.Parcel in)
public void setTimestamp(java.lang.Long timestamp)
timestamp
- the timestamp to set for this message.public boolean isTimestamped()
public java.lang.Long getTimestamp()
public java.util.Date getDate()
public void setExtras(java.util.Map<java.lang.String,java.lang.Object> extras)
public boolean hasExtras()
public java.util.Map<java.lang.String,java.lang.Object> getExtras()
public void untimestamp()
public void timestamp()
public NamedVehicleMessage asNamedMessage()
public SimpleVehicleMessage asSimpleMessage()
public EventedSimpleVehicleMessage asEventedMessage()
public CanMessage asCanMessage()
public CommandResponse asCommandResponse()
public DiagnosticRequest asDiagnosticRequest()
public DiagnosticResponse asDiagnosticResponse()
public KeyedMessage asKeyedMessage()
public java.lang.String toString()
toString
in class java.lang.Object
public int describeContents()
describeContents
in interface android.os.Parcelable
public int compareTo(VehicleMessage other)
compareTo
in interface java.lang.Comparable<VehicleMessage>
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public void writeToParcel(android.os.Parcel out, int flags)
writeToParcel
in interface android.os.Parcelable
protected void readFromParcel(android.os.Parcel in)