01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc.util.diff;
05:
06: import com.tc.util.Assert;
07:
08: /**
09: * Represents a difference between two objects somewhere in their object graphs.
10: */
11: public abstract class Difference {
12:
13: private final DifferenceContext where;
14:
15: public Difference(DifferenceContext where) {
16: Assert.assertNotNull(where);
17: this .where = where;
18: }
19:
20: public DifferenceContext where() {
21: return this .where;
22: }
23:
24: public abstract Object a();
25:
26: public abstract Object b();
27:
28: public abstract String toString();
29:
30: public boolean equals(Object that) {
31: if (!(that instanceof Difference))
32: return false;
33:
34: Difference diffThat = (Difference) that;
35:
36: return this.where.rawEquals(diffThat.where);
37: }
38:
39: }
|