List of utility methods to do Long Number Create
long | toLong(Object num, long defValue) to Long if (num != null) { String value = String.valueOf(num); try { return Long.parseLong(value); } catch (Exception e) { return defValue; ... |
long | toLong(Object number) to Long if (number == null) { return 0L; } else if (number instanceof Number) { return ((Number) number).longValue(); } else if (number instanceof String) { String str = (String) number; int isNumber = isNumeric(str); return isNumber == 1 ? Long.parseLong(str) : (isNumber == 2 ? Double.valueOf(str).longValue() : 0L); ... |
long | toLong(Object o) to Long if (o instanceof Byte) { return (Byte) o; } else if (o instanceof Short) { return (Short) o; } else if (o instanceof Integer) { return (Integer) o; } else if (o instanceof Long) { return (Long) o; ... |
Long | toLong(Object o) to Long if (o == null) return null; if (o.getClass() == Long.class) return (Long) o; if (o.getClass() == Boolean.class) return booleanToLong((Boolean) o); if (o.getClass() == Byte.class) return (long) ((Byte) o).byteValue(); ... |
Long | toLong(Object o) to Long Long result; if (o == null) { result = null; } else if (o instanceof Number) { Number n = (Number) o; result = n.longValue(); } else { try { ... |
Long | toLong(Object ob, Long defaultLong) to Long if (ob == null) { return defaultLong; if (ob instanceof Integer) { return ((Integer) ob).longValue(); } else if (ob instanceof Float) { return ((Float) ob).longValue(); } else if (ob instanceof Double) { ... |
long | toLong(Object obj) to Long return Long.parseLong(toString(obj).trim());
|
Long | toLong(Object obj) to Long if (obj instanceof String) return Long.parseLong((String) obj); if (obj instanceof Byte) { Byte b = (Byte) obj; return b.longValue(); if (obj instanceof Short) { Short s = (Short) obj; ... |
long | toLong(Object obj) Convert object returned from server to long. return (obj != null) ? (Long) obj : 0;
|
long | toLong(Object obj) Get the long value of this object, only if the object is an instance of Number return (obj instanceof Number) ? ((Number) obj).longValue() : 0L; |