private boolean isWorkingDay(final WeekDay weekDay) { for (String configWorkingDay : configWorkingDays) { if (configWorkingDay.equalsIgnoreCase(weekDay.name())) { return true; } } return false; }
private static WeekDay findWeekDay(final String workingDay) { WeekDay[] weekDays = WeekDay.values(); // all weekdays for (WeekDay weekDay : weekDays) { if (weekDay.name().equalsIgnoreCase(workingDay)) { return weekDay; } } throw new RuntimeException( "The configured working day " + workingDay + " is not a week day enum."); }