org.acegisecurity.acls.objectidentity
Interface ObjectIdentity

All Superinterfaces:
Serializable
All Known Implementing Classes:
ObjectIdentityImpl

public interface ObjectIdentity
extends Serializable

Interface representing the identity of an individual domain object instance.

As implementations are used as the key for caching and lookup, it is essential that implementations provide methods so that object-equality rather than reference-equality can be relied upon by caches. In other words, a cache can consider two ObjectIdentitys equal if identity1.equals(identity2), rather than reference-equality of identity1==identity2.

Version:
$Id: ObjectIdentity.java 1784 2007-02-24 21:00:24Z luke_t $
Author:
Ben Alex

Method Summary
 boolean equals(Object obj)
          Refer to the java.lang.Object documentation for the interface contract.
 Serializable getIdentifier()
          Obtains the actual identifier.
 Class getJavaType()
          Obtains the Java type represented by the domain object.
 int hashCode()
          Refer to the java.lang.Object documentation for the interface contract.
 

Method Detail

equals

boolean equals(Object obj)
Refer to the java.lang.Object documentation for the interface contract.

Overrides:
equals in class Object
Parameters:
obj - to be compared
Returns:
true if the objects are equal, false otherwise

getIdentifier

Serializable getIdentifier()
Obtains the actual identifier. This identifier must not be reused to represent other domain objects with the same javaType.

Because ACLs are largely immutable, it is strongly recommended to use a synthetic identifier (such as a database sequence number for the primary key). Do not use an identifier with business meaning, as that business meaning may change.

Returns:
the identifier (unique within this javaType

getJavaType

Class getJavaType()
Obtains the Java type represented by the domain object.

Returns:
the Java type of the domain object

hashCode

int hashCode()
Refer to the java.lang.Object documentation for the interface contract.

Overrides:
hashCode in class Object
Returns:
a hash code representation of this object


Copyright © 2004-2011 Interface21, Inc. All Rights Reserved.