Here you can find the source of toLongAsObject(Object obj)
public static Long toLongAsObject(Object obj)
//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; } }