Package org.apache.commons.lang3.builder
Class IDKey
- java.lang.Object
-
- org.apache.commons.lang3.builder.IDKey
-
final class IDKey extends java.lang.Object
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.
-
-
Constructor Summary
Constructors Constructor Description IDKey(java.lang.Object _value)
Constructor for IDKey
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object other)
checks if instances are equalint
hashCode()
returns hash code - i.e.
-
-
-
Method Detail
-
hashCode
public int hashCode()
returns hash code - i.e. the system identity hashcode.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- the hashcode
-
equals
public boolean equals(java.lang.Object other)
checks if instances are equal- Overrides:
equals
in classjava.lang.Object
- Parameters:
other
- The other object to compare to- Returns:
- if the instances are for the same object
-
-