Class Pair<K,V>

java.lang.Object
me.hsgamer.hscore.common.Pair<K,V>
Type Parameters:
K - the type of the key
V - the type of the value

public class Pair<K,V> extends Object
Store the key and the value in pair
  • Method Details

    • of

      public static <K, V> Pair<K,V> of(K key, V value)
      Create a new pair
      Type Parameters:
      K - the type of the key
      V - the type of the value
      Parameters:
      key - the key
      value - the value
      Returns:
      the pair
    • of

      public static <K, V> Pair<K,V> of(Map.Entry<K,V> entry)
      Create a new pair from the map entry
      Type Parameters:
      K - the type of the key
      V - the type of the value
      Parameters:
      entry - the map entry
      Returns:
      the pair
    • getKey

      public K getKey()
      Get the key
      Returns:
      the key
    • getValue

      public V getValue()
      Get the value
      Returns:
      the value
    • setValue

      public void setValue(V value)
      Set the value
      Parameters:
      value - the value