Class KeyValuePair<TKey,​TValue>

  • Type Parameters:
    TKey - the type of the key
    TValue - the type of the value

    public class KeyValuePair<TKey,​TValue>
    extends Object
    Provides a structure of a key and a corresponding value.
    • Constructor Detail

      • KeyValuePair

        public KeyValuePair​(TKey key,
                            TValue value)
        Construct a KeyValuePair with the given key and the corresponding value.
        Parameters:
        key - the key
        value - the value
    • Method Detail

      • getKey

        public TKey getKey()
        Retrieves the key of the KeyValuePair
        Returns:
        the key
      • getValue

        public TValue getValue()
        Retrieves the value of the KeyValuePair
        Returns:
        the value