Class Pair<K,​V>

  • Type Parameters:
    K - the type of first element of the Pair
    V - the type of second element of the Pair
    All Implemented Interfaces:
    Serializable

    public class Pair<K,​V>
    extends Object
    implements Serializable
    This is an Easy Util Class to store two Instances.
    See Also:
    Serialized Form
    • Constructor Detail

      • Pair

        public Pair​(K key,
                    V value)
    • Method Detail

      • of

        @NotNull
        @Contract(value="_, _ -> new",
                  pure=true)
        public static <K,​V> Pair<K,​V> of​(K key,
                                                     V value)
        Constructs a new Pair with static method
        Type Parameters:
        K - the first element type
        V - the second element type
        Parameters:
        key - the first element
        value - the second element
        Returns:
        the pair
      • getKey

        public K getKey()
      • getValue

        public V getValue()
      • getLeft

        public K getLeft()
      • getRight

        public V getRight()
      • getFirst

        public K getFirst()
      • getSecond

        public V getSecond()