Java Long Number From toLongAsObject(Object obj)

Here you can find the source of toLongAsObject(Object obj)

Description

to Long As Object

License

Open Source License

Declaration

public static Long toLongAsObject(Object obj) 

Method Source Code

//package com.java2s;

public class Main {
    public static Long toLongAsObject(Object obj) {
        if (obj != null) {
            if (obj instanceof Long) {
                return (Long) obj;
            } else {
                try {
                    return Long.parseLong(String.valueOf(obj));
                } catch (Exception e) {
                }/*from w w w . j a va  2  s. co m*/
            }
        }

        return null;
    }
}

Related

  1. longFromBytes(byte[] bytes, int index)
  2. longFromBytes(byte[] bytes, int offset)
  3. longFromDB(String dbLong)
  4. longFromLex(byte[] bytes)
  5. longFromObject(Object o)
  6. toLongBE(byte[] b, int i)
  7. toLongBE(byte[] src, int offset)
  8. toLongDate()
  9. toLongDefaultIfNull(Long configured, long theDefault)