List of utility methods to do Long Number Create
long | toLong(Object obj) to Long long value = 0; if (obj != null) { String objVal = String.valueOf(obj); if (objVal.length() > 0) { Long intObj = Long.parseLong(objVal); value = intObj.longValue(); return value; |
long | toLong(Object obj) to Long Long i = toLongAsObject(obj); if (i != null) { return i.longValue(); return 0; |
long | toLong(Object obj) Converts an Object to a long .
Long result = toLongObject(obj);
return result == null ? 0 : result.longValue();
|
Long | toLong(Object obj) to Long if (isNull(obj)) { return getNull(); if (obj instanceof Long) { return (Long) obj; if (obj instanceof Integer || obj instanceof Short || obj instanceof Byte) { return Long.parseLong(obj.toString()); ... |
long | toLong(Object obj) to Long return toLong(obj, 0L);
|
Long | toLong(Object obj, String pattern) to Long if (obj == null) { return null; } else if (obj instanceof Long) { return (Long) obj; } else if (obj instanceof Number) { return Long.valueOf(((Number) obj).longValue()); } else if (obj instanceof String) { return toLong((String) obj); ... |
Long | toLong(Object object) to Long Long l = null; if (object != null) { if (object instanceof Integer) l = Long.valueOf(((Integer) object).longValue()); else if (object instanceof Long) l = (Long) object; else if (object instanceof String) l = Long.valueOf((String) object); ... |
Long | toLong(Object object) to Long Long longValue; if (object instanceof String) { longValue = (long) Integer.valueOf((String) object); } else if (object instanceof Number) { longValue = (long) ((Number) object).intValue(); } else if (object == null) { longValue = null; } else { ... |
long | toLong(Object object) to Long return object instanceof Number ? ((Number) object).longValue() : Long.parseLong(object.toString()); |
long | toLong(Object object) Lenient convertor -- accepts String or any Number subclass. if (object == null) return 0; if (object instanceof Number) return ((Number) object).longValue(); return Long.valueOf((String) object); |