01: package org.drools;
02:
03: /*
04: * Copyright 2005 JBoss Inc
05: *
06: * Licensed under the Apache License, Version 2.0 (the "License");
07: * you may not use this file except in compliance with the License.
08: * You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS,
14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15: * See the License for the specific language governing permissions and
16: * limitations under the License.
17: */
18:
19: public class MockFactHandle implements FactHandle {
20: /**
21: *
22: */
23: private static final long serialVersionUID = 400L;
24: private int id;
25:
26: public MockFactHandle(final int id) {
27: this .id = id;
28: }
29:
30: public String toExternalForm() {
31: return "[fact:" + this .id + "]";
32: }
33:
34: public int hashCode() {
35: return this .id;
36: }
37:
38: public boolean equals(final Object object) {
39: if (this == object) {
40: return true;
41: }
42:
43: if (object == null || getClass() != object.getClass()) {
44: return false;
45: }
46:
47: return ((MockFactHandle) object).id == this .id;
48: }
49:
50: public long getId() {
51: return this .id;
52: }
53:
54: public long getRecency() {
55: // TODO Auto-generated method stub
56: return 0;
57: }
58: }
|