01: package liquibase.database.sql;
02:
03: import java.util.Date;
04:
05: public class ComputedDateValue extends Date {
06:
07: private String value;
08:
09: public ComputedDateValue(String value) {
10: this .value = value;
11: }
12:
13: public String getValue() {
14: return value;
15: }
16:
17: public long getTime() {
18: throw new RuntimeException("Date computed by database");
19: }
20:
21: public String toString() {
22: return getValue();
23: }
24:
25: public boolean equals(Object obj) {
26: if (obj instanceof ComputedDateValue) {
27: return this .toString().equals(obj.toString());
28: } else {
29: return super .equals(obj);
30: }
31: }
32:
33: public int hashCode() {
34: return this.toString().hashCode();
35: }
36: }
|