public static Integer getInteger ( Object object ) { try { if ( object instanceof Integer ) return ( Integer ) object ; if ( object instanceof String ) return Integer . valueOf ( ( String ) object ) ; } catch ( NumberFormatException nfe ) { } return null ; }
Return an integer if it is an Integer or can get Integer from String else null