1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.acegisecurity.acl.basic;
17
18 import java.io.Serializable;
19
20
21 /***
22 * Interface representing the identity of an individual domain object instance.
23 *
24 * <P>
25 * It should be noted that <code>AclObjectIdentity</code> instances are created
26 * in various locations throughout the package. As
27 * <code>AclObjectIdentity</code>s are used as the key for caching, it is
28 * essential that implementations provide methods so that object-equality
29 * rather than reference-equality can be relied upon by caches. In other
30 * words, a cache can consider two <code>AclObjectIdentity</code>s equal if
31 * <code>identity1.equals(identity2)</code>, rather than reference-equality of
32 * <code>identity1==identity2</code>.
33 * </p>
34 *
35 * <P>
36 * In practical terms this means you must implement the standard
37 * <code>java.lang.Object</code> methods shown below. Depending on your
38 * cache's internal structure, you may also need to implement special
39 * interfaces such as <code>java.util.Comparator</code> or
40 * <code>java.lang.Comparable</code>.
41 * </p>
42 *
43 * @author Ben Alex
44 * @version $Id: AclObjectIdentity.java,v 1.2 2005/11/17 00:55:47 benalex Exp $
45 */
46 public interface AclObjectIdentity extends Serializable {
47
48
49 /***
50 * Refer to the <code>java.lang.Object</code> documentation for the
51 * interface contract.
52 *
53 * @param obj to be compared
54 *
55 * @return <code>true</code> if the objects are equal, <code>false</code>
56 * otherwise
57 */
58 public boolean equals(Object obj);
59
60 /***
61 * Refer to the <code>java.lang.Object</code> documentation for the
62 * interface contract.
63 *
64 * @return a hash code representation of this object
65 */
66 public int hashCode();
67 }