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.Object
An 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 K
wrappedKey
The wrapped key.
-
Constructor Summary
Constructors Constructor Description ReferenceEqualityKey(K wrappedKey)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
Equals.K
get()
Get the wrapped key.int
hashCode()
Hash code.java.lang.String
toString()
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:
hashCode
in classjava.lang.Object
- Returns:
- the int
-
equals
public boolean equals(java.lang.Object obj)
Equals.- Overrides:
equals
in classjava.lang.Object
- Parameters:
obj
- the obj- Returns:
- true, if successful
-
toString
public java.lang.String toString()
To string.- Overrides:
toString
in classjava.lang.Object
- Returns:
- the string
-
-