Here you can find the source of ToLong(String s)
public static final Long ToLong(String s)
//package com.java2s; //License from project: Apache License public class Main { public static final Long ToLong(String s) { if (ToString(s).isEmpty()) { return null; }/*from ww w .j a va 2 s. c o m*/ return Long.parseLong(ToString(s)); } public static final Long ToLong(Object o) { return ToLong(ToString(o)); } public static final String ToString(Object o) { return o != null ? o.toString() : ""; } public static final String ToString(String s) { return s != null ? s : ""; } }