Class Tuple<K,​V>

  • Type Parameters:
    K - The key type for the Tuple
    V - The associated Value type

    public class Tuple<K,​V>
    extends Object
    A key/value tuple for simple two column persistent Tables with sorted keys.
    Author:
    Apache Directory Project
    • Constructor Detail

      • Tuple

        public Tuple()
        Do nothing default that has a null key and null value.
      • Tuple

        public Tuple​(K key,
                     V value)
        Creates a Tuple using a key and a value.
        Parameters:
        key - the key to set
        value - the value to set
    • Method Detail

      • getKey

        public K getKey()
        Gets the key for this Tuple.
        Returns:
        the Tuple's key
      • setKey

        public Tuple<K,​VsetKey​(K key)
        Sets the key for this Tuple.
        Parameters:
        key - the new key to set
        Returns:
        this Tuple itself to set and return
      • getValue

        public V getValue()
        Gets the value for this Tuple.
        Returns:
        the Tuple's value
      • setValue

        public Tuple<K,​VsetValue​(V value)
        Sets the value for this Tuple.
        Parameters:
        value - the new value to set
        Returns:
        this Tuple itself to set and return
      • setBoth

        public Tuple<K,​VsetBoth​(K key,
                                        V value)
        Sets both the key and the value for this Tuple in one call and returns this Tuple object. This is useful for setting the tuples key and value then returning it.
        Parameters:
        key - the new key to set
        value - the new value to set
        Returns:
        this Tuple itself to set and return
      • setBoth

        public Tuple<K,​VsetBoth​(Tuple<K,​V> tupleToCopy)
        Sets both the key and the value for this Tuple in one call and returns this Tuple object. This is useful for setting the tuples key and value then returning it.
        Parameters:
        tupleToCopy - the tuple to copy
        Returns:
        this Tuple itself to set and return