Here you can find the source of ToInteger(String s)
public static final Integer ToInteger(String s)
//package com.java2s; //License from project: Apache License public class Main { public static final Integer ToInteger(String s) { if (ToString(s).isEmpty()) { return null; }/*from w w w.j a va2 s.c o m*/ return Integer.parseInt(ToString(s)); } public static final Integer ToInteger(Object o) { return ToInteger(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 : ""; } }