示例#1
0
  @Override
  public String toString() {
    String useNextText = "";
    if (!interval.getToDate().equals(useNext)) {
      useNextText = ", use next " + DateHelper.formatDateTimeInteligently(useNext);
    }

    return interval.toString() + useNextText;
  }
示例#2
0
  /**
   * 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());
  }
示例#3
0
 @Override
 public Date getToDate() {
   return interval.getToDate();
 }
示例#4
0
 public SimpleScheduleResult(Interval interval) {
   this(interval, interval.getToDate());
 }