Here you can find the source of toLong(Object object)
public static long toLong(Object object)
//package com.java2s; //License from project: Apache License public class Main { public static long toLong(Object object) { return object instanceof Number ? ((Number) object).longValue() : Long.parseLong(object.toString()); }//w w w .j a va 2 s . c o m public static String toString(Object object) { return object == null ? null : object.toString(); } }