Here you can find the source of toInteger(Object value)
public static Integer toInteger(Object value)
//package com.java2s; //License from project: Apache License public class Main { /** EMPTY [String] */ public static final String EMPTY = ""; public static Integer toInteger(Object value) { try {//from w ww. j a va2 s. c om if (value == null || EMPTY.equals(value)) { return null; } return Integer.valueOf(value.toString()); } catch (Exception e) { e.printStackTrace(); return null; } } }