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 { /** EMPTY [String] */ public static final String EMPTY = ""; public static Long toLong(Object value) { try {// w w w. ja v a 2 s.c o m if (value == null || EMPTY.equals(value)) { return null; } return Long.valueOf(value.toString()); } catch (Exception e) { e.printStackTrace(); return null; } } }