Here you can find the source of toInteger(String value)
public static Integer toInteger(String value)
//package com.java2s; //License from project: Open Source License public class Main { public static Integer toInteger(String value) { if (null == value) { return null; }//from w ww . ja v a 2 s. c o m value = value.trim(); if ("null".equals(value)) { return null; } Double d = Double.parseDouble(value); return d.intValue(); } public static Integer toInteger(Object value) { if (null == value) { return null; } return toInteger(String.valueOf(value)); } }