Here you can find the source of toInt(Object object)
public static int toInt(Object object)
//package com.java2s; //License from project: Apache License public class Main { public static int toInt(Object object) { return object instanceof Number ? ((Number) object).intValue() : Integer.parseInt(object.toString()); }//from w w w . j av a 2 s. c o m public static String toString(Object object) { return object == null ? null : object.toString(); } }