mirror of
https://github.com/servalproject/serval-dna.git
synced 2024-12-19 05:07:56 +00:00
Add Java Date for timestamps
This commit is contained in:
parent
f060e4dc59
commit
fb2322d45f
@ -1,5 +1,7 @@
|
||||
package org.servalproject.servaldna.meshmb;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* Created by jeremy on 10/10/16.
|
||||
*/
|
||||
@ -9,6 +11,7 @@ public class PlyMessage implements Comparable<PlyMessage>{
|
||||
public final long offset;
|
||||
public final String token;
|
||||
public final long timestamp;
|
||||
public final Date date;
|
||||
public final String text;
|
||||
|
||||
public PlyMessage(long _row, long offset, String token, long timestamp, String text){
|
||||
@ -16,6 +19,7 @@ public class PlyMessage implements Comparable<PlyMessage>{
|
||||
this.offset = offset;
|
||||
this.token = token;
|
||||
this.timestamp = timestamp;
|
||||
this.date = new Date(timestamp * 1000);
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
|
@ -24,6 +24,8 @@ import org.servalproject.servaldna.Subscriber;
|
||||
import org.servalproject.servaldna.SubscriberId;
|
||||
import org.servalproject.servaldna.ServalDInterfaceException;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class MeshMSMessage implements Comparable<MeshMSMessage>{
|
||||
|
||||
public enum Type {
|
||||
@ -47,6 +49,7 @@ public class MeshMSMessage implements Comparable<MeshMSMessage>{
|
||||
public final boolean isDelivered;
|
||||
public final boolean isRead;
|
||||
public final Long timestamp;
|
||||
public final Date date;
|
||||
public final Long ackOffset;
|
||||
|
||||
protected MeshMSMessage(int rowNumber,
|
||||
@ -87,6 +90,7 @@ public class MeshMSMessage implements Comparable<MeshMSMessage>{
|
||||
this.isDelivered = delivered;
|
||||
this.isRead = read;
|
||||
this.timestamp = timestamp;
|
||||
this.date = new Date((timestamp ==null?0:timestamp * 1000));
|
||||
this.ackOffset = ack_offset;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user