Esempio n. 1
0
 private boolean isWorkingDay(final WeekDay weekDay) {
   for (String configWorkingDay : configWorkingDays) {
     if (configWorkingDay.equalsIgnoreCase(weekDay.name())) {
       return true;
     }
   }
   return false;
 }
Esempio n. 2
0
  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.");
  }