01: /**********************************************************************
02: Copyright (c) 2003 Erik Bengtson and others. All rights reserved.
03: Licensed under the Apache License, Version 2.0 (the "License");
04: you may not use this file except in compliance with the License.
05: You may obtain a copy of the License at
06:
07: http://www.apache.org/licenses/LICENSE-2.0
08:
09: Unless required by applicable law or agreed to in writing, software
10: distributed under the License is distributed on an "AS IS" BASIS,
11: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12: See the License for the specific language governing permissions and
13: limitations under the License.
14:
15:
16: Contributors:
17: 2003 Andy Jefferson - coding standards
18: ...
19: **********************************************************************/package org.jpox.store.poid;
20:
21: import java.io.Serializable;
22:
23: /**
24: * Persistent Object id. A general purpose oid. The OID can be of any
25: * kind, String, Long, Date, Application ID, etc.
26: *
27: * @version $Revision: 1.3 $
28: */
29: class Poid implements Serializable {
30: /**
31: * the oid
32: */
33: private Object oid;
34:
35: /**
36: * Constructor for Poid
37: * @param oid The Object ID
38: */
39: Poid(Object oid) {
40: this .oid = oid;
41: }
42:
43: /**
44: * Returns the oid.
45: * @return The OID
46: */
47: public Object getOid() {
48: return oid;
49: }
50:
51: /**
52: * Sets the oid.
53: * @param oid The oid to set
54: */
55: public void setOid(Object oid) {
56: this .oid = oid;
57: }
58:
59: /**
60: * @param obj The object to compare against
61: * @see java.lang.Object#equals(Object)
62: * @return boolean the result of the comparation
63: */
64: public boolean equals(Object obj) {
65: if (!(obj instanceof Poid)) {
66: return false;
67: }
68: return ((Poid) obj).getOid().equals(this.getOid());
69: }
70: }
|