Class Pair<K,V>

java.lang.Object
org.kingdoms.data.Pair<K,V>
All Implemented Interfaces:
Map.Entry<K,V>

public final class Pair<K,V> extends Object implements Map.Entry<K,V>
  • Constructor Details

    • Pair

      public Pair(K key, V value)
  • Method Details

    • of

      public static <K, V> Pair<K,V> of(K key, V value)
    • of

      public static <K, V> Pair<K,V> of(Map.Entry<K,V> entry)
    • empty

      public static <K, V> Pair<K,V> empty()
    • getKey

      public K getKey()
      Specified by:
      getKey in interface Map.Entry<K,V>
    • setKey

      public void setKey(K key)
    • getValue

      public V getValue()
      Specified by:
      getValue in interface Map.Entry<K,V>
    • setValue

      public V setValue(V value)
      Specified by:
      setValue in interface Map.Entry<K,V>
    • isKeyPresent

      public boolean isKeyPresent()
    • isValuePresent

      public boolean isValuePresent()
    • areBothPresent

      public boolean areBothPresent()
    • areBothNull

      public boolean areBothNull()
    • equals

      public boolean equals(Object obj)
      Specified by:
      equals in interface Map.Entry<K,V>
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface Map.Entry<K,V>
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object