Java Utililty Methods Long Number Create

List of utility methods to do Long Number Create

Description

The list of methods to do Long Number Create are organized into topic(s).

Method

longtoLong(String param)

Convert to Long

try {
    return Long.valueOf(param.trim());
} catch (Exception e) {
    return 0;
longtoLong(String parameter)
to Long
return Long.parseLong(parameter);
longtoLong(String s)
to Long
byte[] bytes = s.getBytes();
long value = byteToInt(bytes, 0) & 0xFFFFFFFFL;
return value;
LongtoLong(String s)
Translate a string s to an Long.
Long l = null;
try {
    l = Long.parseLong(s);
} catch (NumberFormatException e) {
return l;
LongToLong(String s)
To Long
if (ToString(s).isEmpty()) {
    return null;
return Long.parseLong(ToString(s));
LongtoLong(String s)
to Long
return s.length() == 0 ? null : Long.parseLong(s, 32);
LongtoLong(String s)
to Long
if (isEmptyTrim(s)) {
    return 0L;
return new Long((long) val(s.trim()));
LongtoLong(String s)
to Long
if (s == null)
    return null;
if ("N/A".equals(s))
    return null;
int dotPos;
if ((dotPos = s.indexOf('.')) != -1) {
    s = s.substring(0, dotPos + 3);
try {
    return Long.valueOf(s.replace(".", ""));
} catch (NumberFormatException e) {
    return null;
longtoLong(String s)
to Long
try {
    if ((s != null) && (!("".equals(s.trim()))))
        return Long.parseLong(s);
} catch (Exception exception) {
return 0L;
longtoLong(String s, long defValue)
to Long
Long result = toLong(s);
return ((result != null) ? result.longValue() : defValue);