01: package com.mockrunner.mock.connector.cci;
02:
03: import javax.resource.cci.Record;
04:
05: /**
06: * Mock implementation of <code>Record</code>.
07: */
08: public class MockRecord implements Record {
09: private String recordName;
10: private String recordDescription;
11:
12: public MockRecord() {
13: this ("MockrunnerGenericRecord");
14: }
15:
16: public MockRecord(String name) {
17: this (name, name);
18: }
19:
20: public MockRecord(String name, String description) {
21: recordName = name;
22: recordDescription = description;
23: }
24:
25: public String getRecordName() {
26: return recordName;
27: }
28:
29: public String getRecordShortDescription() {
30: return recordDescription;
31: }
32:
33: public void setRecordName(String recordName) {
34: this .recordName = recordName;
35: }
36:
37: public void setRecordShortDescription(String recordDescription) {
38: this .recordDescription = recordDescription;
39: }
40:
41: public boolean equals(Object object) {
42: if (null == object)
43: return false;
44: if (!object.getClass().equals(this .getClass()))
45: return false;
46: MockRecord other = (MockRecord) object;
47: if (null != recordName && !recordName.equals(other.recordName))
48: return false;
49: if (null != recordDescription
50: && !recordDescription.equals(other.recordDescription))
51: return false;
52: if (null == recordName && null != other.recordName)
53: return false;
54: if (null == recordDescription
55: && null != other.recordDescription)
56: return false;
57: return true;
58: }
59:
60: public int hashCode() {
61: int hashCode = 17;
62: if (null != recordName)
63: hashCode = (31 * hashCode) + recordName.hashCode();
64: if (null != recordDescription)
65: hashCode = (31 * hashCode) + recordDescription.hashCode();
66: return hashCode;
67: }
68:
69: public String toString() {
70: StringBuffer buffer = new StringBuffer();
71: buffer.append(this .getClass().getName() + ", ");
72: buffer.append("name: " + recordName + ", ");
73: buffer.append("description: " + recordDescription);
74: return buffer.toString();
75: }
76:
77: public Object clone() throws CloneNotSupportedException {
78: return super.clone();
79: }
80: }
|