public static int parseIntOrDefault ( final String value , final int defaultValue ) { if ( null == value ) { return defaultValue ; } return Integer . parseInt ( value ) ; }
Parse an int from a String . If the String is null then return the defaultValue .