List of utility methods to do Object to Long
long | objectToLong(Object obj) object To Long return objectToLong(obj, 0);
|
Long | objectToPostiveLong(Object object) Supports any object which toString method return a positive numeric as String. if (object == null) { return null; try { Long result = Long.parseLong(object.toString()); if (result >= 0) { return result; } else { ... |
short | objectToShort(Object o) object To Short if (o instanceof Number) return ((Number) o).shortValue(); try { if (o == null) return -1; else return Short.parseShort(o.toString()); } catch (NumberFormatException e) { ... |
short | objectToShort(Object p1) object To Short if (p1 == null) { return 0; if (p1 instanceof Character) { return (short) ((Character) p1).charValue(); return ((Number) p1).shortValue(); |