Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/DateRange.java @ 3210:ae14f412ba10
SQ: finished the access stuff.
flys-artifacts/trunk@4831 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Thu, 28 Jun 2012 15:46:16 +0000 |
parents | |
children | 5a7b4f890d53 |
comparison
equal
deleted
inserted
replaced
3209:03fc05655258 | 3210:ae14f412ba10 |
---|---|
1 package de.intevation.flys.artifacts.model; | |
2 | |
3 import java.util.Date; | |
4 | |
5 import java.io.Serializable; | |
6 | |
7 public class DateRange | |
8 implements Serializable | |
9 { | |
10 protected Date from; | |
11 protected Date to; | |
12 | |
13 public DateRange(Date from, Date to) { | |
14 this.from = from; | |
15 this.to = to; | |
16 } | |
17 | |
18 public Date getFrom() { | |
19 return from; | |
20 } | |
21 | |
22 public void setFrom(Date from) { | |
23 this.from = from; | |
24 } | |
25 | |
26 public Date getTo() { | |
27 return to; | |
28 } | |
29 | |
30 public void setTo(Date to) { | |
31 this.to = to; | |
32 } | |
33 | |
34 private static final boolean equalDates(Date a, Date b) { | |
35 if (a == null && b != null) return false; | |
36 if (a != null && b == null) return false; | |
37 if (a == null) return true; | |
38 return a.equals(b); | |
39 } | |
40 | |
41 @Override | |
42 public boolean equals(Object other) { | |
43 if (!(other instanceof DateRange)) { | |
44 return false; | |
45 } | |
46 DateRange o = (DateRange)other; | |
47 return equalDates(from, o.from) && equalDates(to, o.to); | |
48 } | |
49 } | |
50 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |