List of utility methods to do Long Number Create
Long | toLong(String value) to Long if (value != null && value.length() > 0) { try { return Long.valueOf(value); } catch (NumberFormatException e) { return 0L; return 0L; ... |
long | toLong(String value) to Long return toLong(value, 0L);
|
long | toLong(String value) Converts a given string into type long. if (isLong(value)) { return Long.parseLong(value); return -1; |
long | toLong(String value, long _default) to Long if (value == null || value.length() == 0) return _default; return Long.valueOf(value); |
long | toLong(String value, long def) Convert String to long if (isEmpty(value)) { return def; try { return Long.valueOf(value); } catch (NumberFormatException e) { e.printStackTrace(); return def; ... |
long | toLong(String value, Long defaultValue) to Long try { if (value == null || "".equals(value.trim())) return defaultValue; value = value.trim(); if (value.startsWith("N") || value.startsWith("n")) return -Long.parseLong(value.substring(1)); return Long.parseLong(value); } catch (Exception e) { ... |
long | toLong(String value, long defaultValue) convert the string to an long, and return the default value if the string is null or does not contain a valid int value if (value != null) { try { return Long.parseLong(value); } catch (NumberFormatException n) { return defaultValue; |
Long | toLong(String value, Long defaultValue) to Long if (isEmpty(value)) return defaultValue; try { return Long.parseLong(value); } catch (Exception e) { return defaultValue; |
Long | toLong(T value) to Long return (value != null ? value.longValue() : null);
|
Long | toLongObject(Object o) to Long Object if (o == null) { return null; Long num; if (o instanceof Long) { num = (Long) o; } else if (o instanceof Number) { num = Long.valueOf(((Number) o).longValue()); ... |