public static Long valueOf(Object o) {
        if (o == null) {
            return null;
        } else if (o instanceof Byte) {
            return (long)(Byte)o;
        } else if (o instanceof Integer) {
            return (long)(Integer)o;
        } else if (o instanceof Double) {
            return (long)(double)(Double)o;
        } else if (o instanceof Float) {
            return (long)(float)(Float)o;
        } else if (o instanceof Long) {
            return (long)(Long)o;
        } else {
            return null;
        }
    }