Here you can find the source of objectToLong(Object obj)
public static long objectToLong(Object obj)
//package com.java2s; //License from project: Apache License public class Main { public static long objectToLong(Object obj) { return objectToLong(obj, 0); }/* w ww. j a v a2 s . com*/ public static long objectToLong(Object obj, long added) { long result = 0; try { result = Long.parseLong(obj.toString()); } catch (Exception e) { result = added; } return result; } }