/** * Checks whether this is a real range, with a start and an * end date, or a date/dateTime posing as a range. * * This hack is necessary to handle treating DateTime as * a DateTimeRange, because dateTimeRange is a supertype of * date and dateTime. * * If this method returns true, you can get the {@link DateTime} * object this object corresponds to using {@link #toDateTime()} * * @return true if start is the same as end */ public boolean isDateTimeOnly() { return start.equals(end); }
/** * Checks whether this is a real range, with a start and an * end date, or a date/dateTime posing as a range. * * This hack is necessary to handle treating DateTime as * a DateTimeRange, because dateTimeRange is a supertype of * date and dateTime. * * If this method returns true, you can get the {@link DateTime} * object this object corresponds to using {@link #toDateTime()} * * @return true if start is the same as end */ public boolean isDateTimeOnly() { return start.equals(end); }
/** * Compares {@link DateTimeValueConstruct} objects based on the date/time * value that they hold. */ @Override public boolean equals(Object rhs) { if (!super.equals(rhs)) { return false; } DateTimeValueConstruct r = (DateTimeValueConstruct) rhs; if (dateTimeValue == null) { return r.dateTimeValue == null; } return dateTimeValue.equals(r.dateTimeValue); }
/** * Compares {@link DateTimeValueConstruct} objects based on the date/time * value that they hold. */ @Override public boolean equals(Object rhs) { if (!super.equals(rhs)) { return false; } DateTimeValueConstruct r = (DateTimeValueConstruct) rhs; if (dateTimeValue == null) { return r.dateTimeValue == null; } return dateTimeValue.equals(r.dateTimeValue); }