Here you can find the source of toIntegerByObject(Object obj)
public static Integer toIntegerByObject(Object obj)
//package com.java2s; //License from project: Apache License public class Main { public static Integer toIntegerByObject(Object obj) { try {//from w ww.j av a2 s. c o m return Integer.valueOf(toStringByObject(obj, true)); } catch (Exception e) { return 0; } } public static String toStringByObject(Object obj) { return toStringByObject(obj, false); } public static String toStringByObject(Object obj, boolean isqdkg) { if (obj == null) { return ""; } else { if (isqdkg) { return obj.toString().trim(); } else { return obj.toString(); } } } }