Class Keyed<K,T>

java.lang.Object
com.landawn.abacus.util.Keyed<K,T>
Type Parameters:
K - the key type
T -
All Implemented Interfaces:
Immutable

@Immutable public final class Keyed<K,T> extends Object implements Immutable
It's designed for performance improvement by only hash/compare key in hashCode/equals method.
Author:
HaiYang Li
See Also:
  • Method Details

    • of

      public static <K, T> Keyed<K,T> of(K key, T val)
      Type Parameters:
      K - the key type
      T -
      Parameters:
      key -
      val -
      Returns:
    • key

      public K key()
      Returns:
    • val

      public T val()
      Returns:
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
      Returns:
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
      Parameters:
      obj -
      Returns:
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns: