question: public static int [ ] parseLEDPattern ( String stringPattern ) { int on , off ; if ( stringPattern == null ) return null ; String [ ] splitPattern = stringPattern . split ( "," ) ; if ( splitPattern . length != 2 ) return null ; final int LED_PATTERN_MIN_SECONDS = 0 ; final int LED_PATTERN_MAX_SECONDS = 60000 ; try { on = Integer . parseInt ( splitPattern [ 0 ] ) ; } catch ( NumberFormatException e ) { return null ; } try { off = Integer . parseInt ( splitPattern [ 1 ] ) ; } catch ( NumberFormatException e ) { return null ; } if ( on >= LED_PATTERN_MIN_SECONDS && on <= LED_PATTERN_MAX_SECONDS && off >= LED_PATTERN_MIN_SECONDS && off <= LED_PATTERN_MAX_SECONDS ) { return new int [ ] { on , off } ; } return null ; }
target:  Parse LED pattern string into int[]