Class ReferenceEqualityKey<K>

java.lang.Object
nonapi.io.github.classgraph.json.ReferenceEqualityKey<K>
Type Parameters:
K - the key type

public class ReferenceEqualityKey<K> extends Object
An object for wrapping a HashMap key so that the hashmap performs reference equality on the keys, not equals() equality.
  • Field Details

    • wrappedKey

      private final K wrappedKey
      The wrapped key.
  • Constructor Details

    • ReferenceEqualityKey

      public ReferenceEqualityKey(K wrappedKey)
      Constructor.
      Parameters:
      wrappedKey - the wrapped key
  • Method Details

    • get

      public K get()
      Get the wrapped key.
      Returns:
      the wrapped key.
    • hashCode

      public int hashCode()
      Hash code.
      Overrides:
      hashCode in class Object
      Returns:
      the int
    • equals

      public boolean equals(Object obj)
      Equals.
      Overrides:
      equals in class Object
      Parameters:
      obj - the obj
      Returns:
      true, if successful
    • toString

      public String toString()
      To string.
      Overrides:
      toString in class Object
      Returns:
      the string