Here you can find the source of toLong(Object value)
public static Long toLong(Object value)
//package com.java2s; //License from project: Apache License public class Main { public static Long toLong(Object value) { if (value == null) { return 0L; } else {/* w ww . j a v a 2 s . c o m*/ Long longNum = new Long(value.toString()); return longNum; } } public static String toString(Object value) { if (value == null) { return ""; } else { return value.toString(); } } }