protected static int safeToInt ( String intstr ) { if ( ! StringUtil . isBlank ( intstr ) ) { try { return Integer . parseInt ( intstr ) ; } catch ( NumberFormatException nfe ) { } } return - 1 ; }
Converts the string to an integer returning - 1 on any error .