Class CacheId
- java.lang.Object
-
- org.eclipse.persistence.internal.identitymaps.CacheId
-
- All Implemented Interfaces:
Serializable
,Comparable<CacheId>
public class CacheId extends Object implements Serializable, Comparable<CacheId>
Defines a wrapper for a primary key (Id) to use as a key in the cache.- Since:
- EclipseLink 2.1
- Author:
- James Sutherland
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(Object value)
Append the value to the end of the primary key values.int
compareTo(CacheId otherId)
Determine if the receiver is greater or less than the key.protected int
computeHash(Object[] primaryKey)
Pre-compute the hash to optimize hash calls.boolean
equals(Object object)
Determine if the receiver is equal to anObject.boolean
equals(CacheId id)
Determine if the receiver is equal to key.Object[]
getPrimaryKey()
boolean
hasArray()
int
hashCode()
Return the precomputed hashcode.void
set(int index, Object value)
Set the value in the primary key values.void
setPrimaryKey(Object[] primaryKey)
String
toString()
-
-
-
Constructor Detail
-
CacheId
public CacheId()
-
CacheId
public CacheId(Object[] primaryKey)
-
-
Method Detail
-
getPrimaryKey
public Object[] getPrimaryKey()
-
setPrimaryKey
public void setPrimaryKey(Object[] primaryKey)
-
add
public void add(Object value)
Append the value to the end of the primary key values.
-
set
public void set(int index, Object value)
Set the value in the primary key values.
-
computeHash
protected int computeHash(Object[] primaryKey)
Pre-compute the hash to optimize hash calls.
-
equals
public boolean equals(Object object)
Determine if the receiver is equal to anObject. If anObject is a CacheKey, do further comparison, otherwise, return false.- Overrides:
equals
in classObject
- See Also:
CacheKey.equals(CacheKey)
-
equals
public boolean equals(CacheId id)
Determine if the receiver is equal to key. Use an index compare, because it is much faster than enumerations.
-
compareTo
public int compareTo(CacheId otherId)
Determine if the receiver is greater or less than the key.- Specified by:
compareTo
in interfaceComparable<CacheId>
-
hasArray
public boolean hasArray()
-
-