KickJava   Java API By Example, From Geeks To Geeks.

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


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