public static int getIntValue ( Object value ) { try { if ( value == null ) return - 1 ; if ( Number . class . isInstance ( value ) ) { return ( ( Number ) value ) . intValue ( ) ; } String str = String . class . isInstance ( value ) ? ( String ) value : value . toString ( ) ; return Integer . parseInt ( str ) ; } catch ( Throwable t ) { throw new RuntimeException ( "Error converting " + value + " to integer:" , t ) ; } }
Converts the specified value to a primitive integer value .