sascha@3210: package de.intevation.flys.artifacts.model; sascha@3210: sascha@3210: import java.util.Date; sascha@3210: sascha@3210: import java.io.Serializable; sascha@3210: sascha@3210: public class DateRange sascha@3210: implements Serializable sascha@3210: { sascha@3210: protected Date from; sascha@3210: protected Date to; sascha@3210: sascha@3210: public DateRange(Date from, Date to) { sascha@3210: this.from = from; sascha@3210: this.to = to; sascha@3210: } sascha@3210: sascha@3210: public Date getFrom() { sascha@3210: return from; sascha@3210: } sascha@3210: sascha@3210: public void setFrom(Date from) { sascha@3210: this.from = from; sascha@3210: } sascha@3210: sascha@3210: public Date getTo() { sascha@3210: return to; sascha@3210: } sascha@3210: sascha@3210: public void setTo(Date to) { sascha@3210: this.to = to; sascha@3210: } sascha@3210: sascha@3210: private static final boolean equalDates(Date a, Date b) { sascha@3210: if (a == null && b != null) return false; sascha@3210: if (a != null && b == null) return false; sascha@3210: if (a == null) return true; sascha@3210: return a.equals(b); sascha@3210: } sascha@3210: sascha@3210: @Override sascha@3210: public boolean equals(Object other) { sascha@3210: if (!(other instanceof DateRange)) { sascha@3210: return false; sascha@3210: } sascha@3210: DateRange o = (DateRange)other; sascha@3210: return equalDates(from, o.from) && equalDates(to, o.to); sascha@3210: } sascha@3210: } sascha@3210: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :