public int getInt ( String name ) { Object value = super . get ( name ) ; if ( value instanceof Integer ) { return ( Integer ) value ; } if ( value == null ) { throw new IllegalArgumentException ( "Setting: '" + name + "', not found!" ) ; } try { return Integer . parseInt ( value . toString ( ) ) ; } catch ( NumberFormatException e ) { throw new IllegalArgumentException ( "Setting: '" + name + "', can't be converted to integer: '" + value + "'!" ) ; } }
Get setting as integer