Package org.apache.commons.lang3.builder
Class IDKey
- java.lang.Object
-
- org.apache.commons.lang3.builder.IDKey
-
final class IDKey extends java.lang.ObjectWrap 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.
-
-
Constructor Summary
Constructors Constructor Description IDKey(java.lang.Object value)Constructs new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object other)Tests if instances are equal.inthashCode()Gets the hash code, the system identity hash code.
-
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object other)
Tests if instances are equal.- Overrides:
equalsin classjava.lang.Object- Parameters:
other- The other object to compare to- Returns:
- if the instances are for the same object
-
hashCode
public int hashCode()
Gets the hash code, the system identity hash code.- Overrides:
hashCodein classjava.lang.Object- Returns:
- the hash code.
-
-