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(Object object, long defaultValue)
Extract the value represented by the given object (Number or String).
if (object == null) {
    return defaultValue;
if (object instanceof Number) {
    return ((Number) object).longValue();
try {
    Double value = Double.valueOf(object.toString().trim());
...
LongtoLong(Object object, Long defaultValue)
to Long
if (object == null) {
    return defaultValue;
if (object instanceof Number) {
    return ((Number) object).longValue();
try {
    Double value = Double.valueOf(object.toString().trim());
...
LongtoLong(Object objectToConvert)
Given an Object of type Integer or Long, converts the Object instance to a Long.
Long convertedLongValue;
if (objectToConvert instanceof Integer) {
    convertedLongValue = new Long((Integer) objectToConvert);
} else {
    convertedLongValue = (Long) objectToConvert;
return convertedLongValue;
longtoLong(Object objValue)
to Long
if (objValue != null) {
    if (objValue instanceof Number) {
        return ((Number) objValue).longValue();
    } else {
        return Long.parseLong(objValue.toString());
} else
    return 0;
...
longtoLong(Object oid)
to Long
return Long.parseLong(String.valueOf(oid));
longtoLong(Object property, long defaultValue)
to Long
if (property == null) {
    return defaultValue;
return Long.parseLong(String.valueOf(property));
LongtoLong(Object val)
to Long
return toDouble(val).longValue();
longtoLong(Object value)
to Long
return (value == null || "null".equals(value.toString())) ? 0 : Long.parseLong(value.toString().trim());
LongtoLong(Object value)
Convert an Object to a Long.
if (value == null)
    return null;
if (value instanceof Long)
    return (Long) value;
if (value instanceof String) {
    if ("".equals((String) value))
        return null;
    return new Long((String) value);
...
LongtoLong(Object value)
to Long
if (value instanceof Long)
    return (Long) value;
if (value instanceof Integer) {
    Integer v = (Integer) value;
    return v.longValue();
if (value instanceof String) {
    try {
...