Пример #1
0
 @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;
 }
Пример #2
0
  @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;
  }