public static int defaultIfNotInteger ( String _possibleInt , int _default ) { if ( isInteger ( _possibleInt ) ) { return Integer . parseInt ( _possibleInt ) ; } return _default ; }
Returns integer converted from string or default if string could not be converted to int .