public static Long castLong(Object o) {
        if (o == null) {
            return null;
        }
        if (o instanceof Number) {
            return ((Number) o).longValue();
        }
        try {
            return Long.valueOf(o.toString());
        } catch (NumberFormatException e) {
            return null;
        }
    }
public static Long castLong(Object o) {
        if (o == null) {
            return null;
        }
        if (o instanceof Number) {
            return ((Number) o).longValue();
        }
        try {
            return Long.valueOf(o.toString());
        } catch (NumberFormatException e) {
            return null;
        }
    }
public static Long castLong ( Object o ) { if ( o == null ) { return null ; } if ( o instanceof Number ) { return ( ( Number ) o ) . longValue ( ) ; } try { return Long . valueOf ( o . toString ( ) ) ; } catch ( NumberFormatException e ) { return null ; } }
Casts a value to a long. May return null.

@param o The object to attempt to cast
@return The object as a long
Casts a value to a long . May return null .