public static boolean isValid ( @ Nullable final String dayOpeningHours ) { if ( dayOpeningHours == null ) { return true ; } final int p = dayOpeningHours . indexOf ( ' ' ) ; if ( p < 0 ) { return false ; } final String dayOfTheWeekStr = dayOpeningHours . substring ( 0 , p ) ; final String hourRangesStr = dayOpeningHours . substring ( p + 1 ) ; return DayOfTheWeek . isValid ( dayOfTheWeekStr ) && HourRanges . isValid ( hourRangesStr ) ; }
Verifies if the string can be converted into an instance of this class .