1 package org.jbpm.context.exe.converter; 2 3 import org.jbpm.context.exe.*; 4 5 public class BooleanToStringConverter implements Converter { 6 7 private static final long serialVersionUID = 1L; 8 9 public static final String TRUE_TEXT = "T"; 10 public static final String FALSE_TEXT = "F"; 11 12 public boolean supports(Class clazz) { 13 return (clazz==Boolean .class); 14 } 15 16 public Object convert(Object o) { 17 String convertedValue = FALSE_TEXT; 18 if (((Boolean )o).booleanValue()) { 19 convertedValue = TRUE_TEXT; 20 } 21 return convertedValue; 22 } 23 24 public Object revert(Object o) { 25 Boolean revertedValue = Boolean.FALSE; 26 if (TRUE_TEXT.equals(o)) { 27 revertedValue = Boolean.TRUE; 28 } 29 return revertedValue; 30 } 31 } 32 | Popular Tags |