1 4 package com.tc.util.diff; 5 6 import org.apache.commons.lang.builder.EqualsBuilder; 7 8 11 public class MockDifference extends Difference { 12 13 private final Object a; 14 private final Object b; 15 16 public MockDifference(DifferenceContext where, Object a, Object b) { 17 super(where); 18 19 this.a = a; 20 this.b = b; 21 } 22 23 public MockDifference(DifferenceContext where) { 24 this(where, new Object (), new Object ()); 25 } 26 27 public Object a() { 28 return this.a; 29 } 30 31 public Object b() { 32 return this.b; 33 } 34 35 public String toString() { 36 return "<MockDifference: " + a() + ", " + b() + ">"; 37 } 38 39 public boolean equals(Object that) { 40 if (!(that instanceof MockDifference)) return false; 41 42 MockDifference mockThat = (MockDifference) that; 43 44 return new EqualsBuilder().appendSuper(super.equals(that)).append(this.a, mockThat.a).append(this.b, mockThat.b) 45 .isEquals(); 46 } 47 48 } | Popular Tags |