@Override public int hashCode() { int result = from.hashCode(); result = 31 * result + to.hashCode(); result = 31 * result + duration.hashCode(); result = 31 * result + holiday.hashCode(); result = 31 * result + (loc != null ? loc.hashCode() : 0); result = 31 * result + shifters.hashCode(); result = 31 * result + selector.hashCode(); result = 31 * result + (customDayOfMonth != null ? customDayOfMonth.hashCode() : 0); result = 31 * result + (customDayOfYear != null ? customDayOfYear.hashCode() : 0); return result; }
@Test public void defaultValues() { ArchiveRecurrence archiveRecurrence = ArchiveRecurrence.builder() .dayOfMonth(DayOfMonth.last()) .dayOfWeek(DayOfWeek.MONDAY) .dayOfYear(DayOfYear.of(1)) .repeat(RepeatKind.MONTHLY) .build(); SchedulingConfiguration configuration = SchedulingConfiguration.DEFAULT_VALUES_BUILDER; assertThat(configuration.getRepeatKind()).isEqualTo(archiveRecurrence.getRepeatKind()); assertThat(configuration.getDayOfMonth()).isEqualTo(archiveRecurrence.getDayOfMonth()); assertThat(configuration.getDayOfWeek()).isEqualTo(archiveRecurrence.getDayOfWeek()); assertThat(configuration.getDayOfYear()).isEqualTo(archiveRecurrence.getDayOfYear()); assertThat(configuration.getHour()).isEqualTo(0); assertThat(configuration.getMinute()).isEqualTo(0); assertThat(configuration.getRecurrence()).isEqualTo(archiveRecurrence); }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Dates dates = (Dates) o; if (customDayOfMonth != null ? !customDayOfMonth.equals(dates.customDayOfMonth) : dates.customDayOfMonth != null) return false; if (customDayOfYear != null ? !customDayOfYear.equals(dates.customDayOfYear) : dates.customDayOfYear != null) return false; if (!duration.equals(dates.duration)) return false; if (!from.equals(dates.from)) return false; if (!holiday.equals(dates.holiday)) return false; if (loc != null ? !loc.equals(dates.loc) : dates.loc != null) return false; if (!selector.equals(dates.selector)) return false; if (!shifters.equals(dates.shifters)) return false; if (!to.equals(dates.to)) return false; return true; }
public boolean isLastDayOfMonth() { return dayOfMonth.isLastDayOfMonth(); }