[vlma-devel] commit: Command: store longs instead of storing Date objects. ( Adrien Grand )

git version control git at videolan.org
Sun Oct 26 18:06:47 CET 2008


vlma | branch: master | Adrien Grand <jpountz at videolan.org> | Sun Oct 26 15:16:59 2008 +0100| [985e37e9a023bf494c424cc5d7fd424da2a3a9c6] | committer: Adrien Grand 

Command: store longs instead of storing Date objects.

> http://git.videolan.org/gitweb.cgi/vlma.git/?a=commit;h=985e37e9a023bf494c424cc5d7fd424da2a3a9c6
---

 .../main/java/org/videolan/vlma/model/Command.java |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/vlma-api/src/main/java/org/videolan/vlma/model/Command.java b/vlma-api/src/main/java/org/videolan/vlma/model/Command.java
index e037b14..c031147 100644
--- a/vlma-api/src/main/java/org/videolan/vlma/model/Command.java
+++ b/vlma-api/src/main/java/org/videolan/vlma/model/Command.java
@@ -33,13 +33,13 @@ public class Command implements Serializable {
 
     private static final long serialVersionUID = 6501305617407724157L;
 
-    private Date date;
+    private long date;
     private Server server;
     private String command;
     private String response;
 
     public Command() {
-        this.date = new Date();
+        this.date = System.currentTimeMillis();
     }
 
     public Command(Server server, String command, String response) {
@@ -58,10 +58,18 @@ public class Command implements Serializable {
     }
 
     public Date getDate() {
+        return new Date(date);
+    }
+
+    public long getDateMillis() {
         return date;
     }
 
     public void setDate(Date date) {
+        this.date = date.getTime();
+    }
+
+    public void setDateMillis(long date) {
         this.date = date;
     }
 



More information about the vlma-devel mailing list