1 43 44 package org.exolab.jms.selector; 45 46 47 55 final class SObjectFactory { 56 57 60 private SObjectFactory() { 61 } 62 63 70 public static SObject create(final Object value) { 71 SObject result = null; 72 if (value instanceof String ) { 73 result = new SString((String ) value); 74 } else if (value instanceof Number ) { 75 if (value instanceof Float || value instanceof Double ) { 76 result = new SDouble(((Number ) value).doubleValue()); 77 } else { 78 result = new SLong(((Number ) value).longValue()); 79 } 80 } else if (value instanceof Boolean ) { 81 if (value.equals(Boolean.TRUE)) { 82 result = SBool.TRUE; 83 } else { 84 result = SBool.FALSE; 85 } 86 } 87 88 return result; 89 } 90 91 } | Popular Tags |