List of utility methods to do Short Number Create
Short | toShort(Object obj) to Short return obj == null ? null : obj instanceof Short ? (Short) obj : newShort(obj); |
short | toShort(Object prmIntObject) to Short short rtnInt16 = 0; if (prmIntObject != null) { if (prmIntObject.toString() != "") { rtnInt16 = Short.parseShort(prmIntObject.toString()); return rtnInt16; |
Short | toShort(Object value) Convert an Object to a Short. if (value == null) return null; if (value instanceof Short) return (Short) value; if (value instanceof String) { if ("".equals((String) value)) return null; return new Short((String) value); ... |
short | toShort(Object value) To short. return Short.parseShort(value.toString());
|
Short | toShort(Object value) to Short try { if (value == null || EMPTY.equals(value)) { return null; return Short.valueOf(value.toString()); } catch (Exception e) { e.printStackTrace(); return null; ... |
short | toShort(Object value) to Short if (value instanceof Number) return ((Number) value).shortValue(); else if (value == null) return 0; else return Short.parseShort(value.toString()); |
long | toShort(Object value) to Short return (value == null || "null".equals(value.toString())) ? 0 : Short.parseShort(value.toString().trim()); |
short | toShort(String input, short defaultValue) to Short try { return Short.parseShort(input); } catch (Exception e) { return defaultValue; |
short | toShort(String numeric) to Short return (isNumeric(numeric)) ? Short.parseShort(numeric) : 0;
|
short | toShort(String str) Convert a If the string is NumberUtils.toShort(null) = 0 NumberUtils.toShort("") = 0 NumberUtils.toShort("1") = 1 return toShort(str, (short) 0); |