1 18 package org.objectweb.speedo.pobjects.basic; 19 20 import org.objectweb.speedo.api.UserFieldMapping; 21 22 26 public class Date2long implements UserFieldMapping { 27 28 32 public Class getStorageType() { 33 return Long.TYPE; 34 } 35 36 40 public Class getMemoryType() { 41 return java.util.Date .class; 42 } 43 44 49 public Object toMemory(Object storagevalue) { 50 return (storagevalue == null 51 ? null 52 : new java.util.Date (((Long ) storagevalue).longValue())); 53 } 54 55 60 public Object toStorage(Object memoryvalue) { 61 return (memoryvalue == null 62 ? null 63 : new Long (((java.util.Date ) memoryvalue).getTime())); 64 } 65 } 66 | Popular Tags |