KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jbpm > context > exe > converter > DateToLongConverter


1 package org.jbpm.context.exe.converter;
2
3 import java.util.*;
4 import org.jbpm.context.exe.*;
5
6 public class DateToLongConverter implements Converter {
7
8   private static final long serialVersionUID = 1L;
9
10   public boolean supports(Class JavaDoc clazz) {
11     return (clazz==Date.class);
12   }
13
14   public Object JavaDoc convert(Object JavaDoc o) {
15     return new Long JavaDoc(((Date)o).getTime());
16   }
17
18   public Object JavaDoc revert(Object JavaDoc o) {
19     return new Date(((Long JavaDoc)o).longValue());
20   }
21 }
22
Popular Tags