1 18 package org.objectweb.speedo.pobjects.basic; 19 20 import org.objectweb.speedo.api.UserFieldMapping; 21 22 26 public class long2String implements UserFieldMapping { 27 28 32 public Class getStorageType() { 33 return java.lang.String .class; 34 } 35 36 40 public Class getMemoryType() { 41 return Long.TYPE; 42 } 43 44 49 public Object toMemory(Object storagevalue) { 50 if (storagevalue == null) { 51 return null; 52 } else { 53 return Long.valueOf((String ) storagevalue); 54 } 55 } 56 57 62 public Object toStorage(Object memoryvalue) { 63 return (memoryvalue == null 64 ? null 65 : memoryvalue.toString()); 66 } 67 } 68 | Popular Tags |