Here you can find the source of toLong(Object value)
public static long toLong(Object value)
//package com.java2s; //License from project: Open Source License public class Main { public static long toLong(Object value) { return (value == null || "null".equals(value.toString())) ? 0 : Long.parseLong(value.toString().trim()); }//from w w w . ja va 2s.c om public static String toString(Object value) { return value == null || "null".equals(value.toString()) ? "" : value.toString(); } }