Package org.apache.commons.lang3.builder
Class IDKey
java.lang.Object
org.apache.commons.lang3.builder.IDKey
Wrap an identity key (System.identityHashCode()) so that an object can only be equal() to itself.
This is necessary to disambiguate the occasional duplicate identityHashCodes that can occur.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
value
-
id
private final int id
-
-
Constructor Details
-
IDKey
IDKey(Object value) Constructs new instance.- Parameters:
value
- The value
-
-
Method Details
-
equals
Tests if instances are equal. -
hashCode
public int hashCode()Gets the hash code, the system identity hash code.
-