Example #1
0
 public static List<Long> toArrayLong(String value) {
   if (value != null) {
     String[] tmp = value.trim().split("\\,");
     if (tmp != null && tmp.length > 0) {
       ArrayList<Long> o = new ArrayList<Long>();
       for (String t : tmp) {
         if (StringUtils.isNumeric(t.trim())) {
           o.add(new Long(t.trim()));
         }
       }
       return o;
     }
   }
   return null;
 }
Example #2
0
 public static Integer toInteger(Object value, Integer defvalue) {
   if (value != null && StringUtils.isNumeric(value)) {
     return new Integer(value.toString());
   }
   return defvalue;
 }
Example #3
0
 public static Double toDouble(Object value, Double defvalue) {
   if (value != null && StringUtils.isNumeric(value)) {
     return new Double(value.toString());
   }
   return defvalue;
 }
Example #4
0
 public static Integer toInteger(String value) {
   if (value != null && StringUtils.isNumeric(value)) {
     return new Integer(value);
   }
   return null;
 }