Package nonapi.io.github.classgraph.json
Class ReferenceEqualityKey<K>
- java.lang.Object
-
- nonapi.io.github.classgraph.json.ReferenceEqualityKey<K>
-
- Type Parameters:
K- the key type
public class ReferenceEqualityKey<K> extends java.lang.ObjectAn object for wrapping a HashMap key so that the hashmap performs reference equality on the keys, not equals() equality.
-
-
Field Summary
Fields Modifier and Type Field Description private KwrappedKeyThe wrapped key.
-
Constructor Summary
Constructors Constructor Description ReferenceEqualityKey(K wrappedKey)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)Equals.Kget()Get the wrapped key.inthashCode()Hash code.java.lang.StringtoString()To string.
-
-
-
Field Detail
-
wrappedKey
private final K wrappedKey
The wrapped key.
-
-
Constructor Detail
-
ReferenceEqualityKey
public ReferenceEqualityKey(K wrappedKey)
Constructor.- Parameters:
wrappedKey- the wrapped key
-
-
Method Detail
-
get
public K get()
Get the wrapped key.- Returns:
- the wrapped key.
-
hashCode
public int hashCode()
Hash code.- Overrides:
hashCodein classjava.lang.Object- Returns:
- the int
-
equals
public boolean equals(java.lang.Object obj)
Equals.- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- the obj- Returns:
- true, if successful
-
toString
public java.lang.String toString()
To string.- Overrides:
toStringin classjava.lang.Object- Returns:
- the string
-
-