Here you can find the source of toInt(Object vo)
public final static int toInt(Object vo)
//package com.java2s; //License from project: Open Source License public class Main { public final static String EMPTY_STR = ""; public final static int toInt(Object vo) { if (vo == null) { return 0; }/* w ww.j ava2 s .c om*/ String voStr = toString(vo); try { return Integer.parseInt(voStr); } catch (Exception e) { } return 0; } public final static String toString(Object vo) { if (vo == null) { return EMPTY_STR; } return vo.toString().trim(); } }