public DayModel getDefaultDay(Reference cal) { for (DayModel day : cal.getDefaultWeekDays()) { if (day.getDefaultDay()) { return day; } } return null; }
private void assignWorkHourRanges(DayModel day, DayModel defaultDay) { day.setWorkHourRanges(new LinkedHashSet<WorkHourRange>()); for (WorkHourRange range : defaultDay.getWorkHourRanges()) { WorkHourRange newRange = new WorkHourRange(); newRange.setDay(day); newRange.setFromTime(range.getFromTime()); newRange.setToTime(range.getToTime()); day.getWorkHourRanges().add(newRange); } }