@Override public String toString() { String useNextText = ""; if (!interval.getToDate().equals(useNext)) { useNextText = ", use next " + DateHelper.formatDateTimeInteligently(useNext); } return interval.toString() + useNextText; }
/** * Test if two intervals are equivalent. * * <p>Intervals are equivalent if there start and end times are the same. * * @param other The interval to test against. * @return true if they are equal. */ public boolean equals(Object other) { if (other == null) { return false; } if (!(other instanceof ScheduleResult)) { return other.equals(this); } ScheduleResult result = (ScheduleResult) other; if (useNext == null) { if (result.getUseNext() != null) { return false; } } else { if (!useNext.equals(result.getUseNext())) { return false; } } return interval.getToDate().equals(result.getToDate()) && interval.getFromDate().equals(result.getFromDate()); }
@Override public Date getToDate() { return interval.getToDate(); }
public SimpleScheduleResult(Interval interval) { this(interval, interval.getToDate()); }