Here you can find the source of toInt(Object value)
public static int toInt(Object value)
//package com.java2s; //License from project: Open Source License public class Main { public static int toInt(Object value) { return (value == null || "null".equals(value.toString())) ? 0 : Integer.parseInt(value.toString().trim()); }/*from w w w . j ava 2s . c o m*/ public static String toString(Object value) { return value == null || "null".equals(value.toString()) ? "" : value.toString(); } }