@Test public void shouldBeEqual() { Interval interval1 = new Interval(LocalDate.of(2017, 1, 14), LocalTime.of(10, 00), LocalDate.of(2017, 1, 15), LocalTime.of(23, 00)); Interval interval2 = new Interval(LocalDate.of(2017, 1, 14), LocalTime.of(10, 00), LocalDate.of(2017, 1, 15), LocalTime.of(23, 00)); boolean equal = interval1.equals(interval2); assertThat(equal, is(true)); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Interval other = (Interval) obj; if (endDate == null) { if (other.endDate != null) return false; } else if (!endDate.equals(other.endDate)) return false; if (endTime == null) { if (other.endTime != null) return false; } else if (!endTime.equals(other.endTime)) return false; if (startDate == null) { if (other.startDate != null) return false; } else if (!startDate.equals(other.startDate)) return false; if (startTime == null) { if (other.startTime != null) return false; } else if (!startTime.equals(other.startTime)) return false; if (zoneId == null) { return other.zoneId == null; } else return zoneId.equals(other.zoneId); }
Interval { @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Interval other = (Interval) obj; if (endDate == null) { if (other.endDate != null) return false; } else if (!endDate.equals(other.endDate)) return false; if (endTime == null) { if (other.endTime != null) return false; } else if (!endTime.equals(other.endTime)) return false; if (startDate == null) { if (other.startDate != null) return false; } else if (!startDate.equals(other.startDate)) return false; if (startTime == null) { if (other.startTime != null) return false; } else if (!startTime.equals(other.startTime)) return false; if (zoneId == null) { return other.zoneId == null; } else return zoneId.equals(other.zoneId); } }
Interval { @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Interval other = (Interval) obj; if (endDate == null) { if (other.endDate != null) return false; } else if (!endDate.equals(other.endDate)) return false; if (endTime == null) { if (other.endTime != null) return false; } else if (!endTime.equals(other.endTime)) return false; if (startDate == null) { if (other.startDate != null) return false; } else if (!startDate.equals(other.startDate)) return false; if (startTime == null) { if (other.startTime != null) return false; } else if (!startTime.equals(other.startTime)) return false; if (zoneId == null) { return other.zoneId == null; } else return zoneId.equals(other.zoneId); } Interval();  Interval(LocalDate startDate, LocalTime startTime, LocalDate endDate, LocalTime endTime);  Interval(LocalDateTime startDateTime, LocalDateTime endDateTime);  Interval(ZonedDateTime zonedStartDateTime, ZonedDateTime zonedEndDateTime);  Interval(LocalDateTime startDateTime, LocalDateTime endDateTime, ZoneId zoneId);  Interval(LocalDate startDate, LocalTime startTime, LocalDate endDate, LocalTime endTime, ZoneId zoneId); }
Interval { @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Interval other = (Interval) obj; if (endDate == null) { if (other.endDate != null) return false; } else if (!endDate.equals(other.endDate)) return false; if (endTime == null) { if (other.endTime != null) return false; } else if (!endTime.equals(other.endTime)) return false; if (startDate == null) { if (other.startDate != null) return false; } else if (!startDate.equals(other.startDate)) return false; if (startTime == null) { if (other.startTime != null) return false; } else if (!startTime.equals(other.startTime)) return false; if (zoneId == null) { return other.zoneId == null; } else return zoneId.equals(other.zoneId); } Interval();  Interval(LocalDate startDate, LocalTime startTime, LocalDate endDate, LocalTime endTime);  Interval(LocalDateTime startDateTime, LocalDateTime endDateTime);  Interval(ZonedDateTime zonedStartDateTime, ZonedDateTime zonedEndDateTime);  Interval(LocalDateTime startDateTime, LocalDateTime endDateTime, ZoneId zoneId);  Interval(LocalDate startDate, LocalTime startTime, LocalDate endDate, LocalTime endTime, ZoneId zoneId); ZoneId getZoneId(); LocalDate getStartDate(); LocalTime getStartTime(); ZonedDateTime getStartZonedDateTime(); long getStartMillis(); LocalDate getEndDate(); LocalTime getEndTime(); ZonedDateTime getEndZonedDateTime(); long getEndMillis(); Interval withDates(LocalDate startDate, LocalDate endDate); Interval withDates(LocalDateTime startDateTime, LocalDateTime endDateTime); Interval withTimes(LocalTime startTime, LocalTime endTime); Interval withStartDate(LocalDate date); Interval withEndDate(LocalDate date); Interval withStartTime(LocalTime time); Interval withStartDateTime(LocalDateTime dateTime); Interval withEndTime(LocalTime time); Interval withEndDateTime(LocalDateTime dateTime); Interval withZoneId(ZoneId zone); LocalDateTime getStartDateTime(); Duration getDuration(); LocalDateTime getEndDateTime(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); }
Interval { @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Interval other = (Interval) obj; if (endDate == null) { if (other.endDate != null) return false; } else if (!endDate.equals(other.endDate)) return false; if (endTime == null) { if (other.endTime != null) return false; } else if (!endTime.equals(other.endTime)) return false; if (startDate == null) { if (other.startDate != null) return false; } else if (!startDate.equals(other.startDate)) return false; if (startTime == null) { if (other.startTime != null) return false; } else if (!startTime.equals(other.startTime)) return false; if (zoneId == null) { return other.zoneId == null; } else return zoneId.equals(other.zoneId); } Interval();  Interval(LocalDate startDate, LocalTime startTime, LocalDate endDate, LocalTime endTime);  Interval(LocalDateTime startDateTime, LocalDateTime endDateTime);  Interval(ZonedDateTime zonedStartDateTime, ZonedDateTime zonedEndDateTime);  Interval(LocalDateTime startDateTime, LocalDateTime endDateTime, ZoneId zoneId);  Interval(LocalDate startDate, LocalTime startTime, LocalDate endDate, LocalTime endTime, ZoneId zoneId); ZoneId getZoneId(); LocalDate getStartDate(); LocalTime getStartTime(); ZonedDateTime getStartZonedDateTime(); long getStartMillis(); LocalDate getEndDate(); LocalTime getEndTime(); ZonedDateTime getEndZonedDateTime(); long getEndMillis(); Interval withDates(LocalDate startDate, LocalDate endDate); Interval withDates(LocalDateTime startDateTime, LocalDateTime endDateTime); Interval withTimes(LocalTime startTime, LocalTime endTime); Interval withStartDate(LocalDate date); Interval withEndDate(LocalDate date); Interval withStartTime(LocalTime time); Interval withStartDateTime(LocalDateTime dateTime); Interval withEndTime(LocalTime time); Interval withEndDateTime(LocalDateTime dateTime); Interval withZoneId(ZoneId zone); LocalDateTime getStartDateTime(); Duration getDuration(); LocalDateTime getEndDateTime(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }