01: package net.sf.mockcreator;
02:
03: import net.sf.mockcreator.utils.CompareByValue;
04:
05: public class ExpectationWithNoParams extends Expectation {
06:
07: public ExpectationWithNoParams(String marker, Object returnValue) {
08: this .marker = marker;
09: this .returnValue = returnValue;
10: }
11:
12: public ExpectationWithNoParams(String marker) {
13: this (marker, null);
14: }
15:
16: public boolean equals(Object obj) {
17:
18: if (obj == this ) {
19: return true;
20: }
21:
22: if (!(obj instanceof IExpectation)) {
23: return false;
24: }
25:
26: IExpectation another = (IExpectation) obj;
27: if (!CompareByValue.equals(getMarker(), another.getMarker()))
28: return false;
29:
30: return true;
31: }
32:
33: public int compareTo(Object o) {
34: if (o instanceof ExpectationWithNoParams)
35: return 0;
36: return 1;
37: }
38: }
|