Here you can find the source of convertObjectToInt(Object value)
public static int convertObjectToInt(Object value)
//package com.java2s; public class Main { public static int convertObjectToInt(Object value) { if (value != null) { if (value instanceof Integer) { return ((Integer) value).intValue(); } else { return Integer.valueOf(value.toString()).intValue(); }// ww w . j av a 2s . c o m } else { throw new NullPointerException("Property value was null so it couldn't be converted to an int."); } } }