Class KeyValuePair<K,V>

  • Type Parameters:
    K - Key class.
    V - Value class.
    Direct Known Subclasses:
    StringValuePair


    public class KeyValuePair<K,V>
    extends java.lang.Object
    Generic key-value pair with optional property map.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected K key
      Pair key.
      protected java.util.Map<java.lang.String,java.lang.Object> propMap
      Property map.
      protected V value
      Pair value.
    • Constructor Summary

      Constructors 
      Constructor Description
      KeyValuePair​(K key, V value)
      Creates a new pair.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object get​(java.lang.String propKey)
      Returns the property attached to the specified key.
      K getKey​()
      Returns the pair key.
      java.util.Map<java.lang.String,java.lang.Object> getProps​()
      Returns all attached properties.
      V getValue​()
      Returns the pair value.
      void set​(java.lang.String propKey, java.lang.Object propValue)
      Sets the property specified by the key and value.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • key

        protected K key
        Pair key.
      • value

        protected V value
        Pair value.
      • propMap

        protected java.util.Map<java.lang.String,java.lang.Object> propMap
        Property map.
    • Constructor Detail

      • KeyValuePair

        public KeyValuePair​(K key,
                            V value)
        Creates a new pair.
        Parameters:
        key - Pair key.
        value - Pair value.
    • Method Detail

      • getValue

        public V getValue​()
        Returns the pair value.
        Returns:
        Pair value.
      • getKey

        public K getKey​()
        Returns the pair key.
        Returns:
        Pair key.
      • get

        public java.lang.Object get​(java.lang.String propKey)
        Returns the property attached to the specified key.
        Parameters:
        propKey - Property key.
        Returns:
        Attached property.
      • set

        public void set​(java.lang.String propKey,
                        java.lang.Object propValue)
        Sets the property specified by the key and value.
        Parameters:
        propKey - Property key.
        propValue - Property value.
      • getProps

        public java.util.Map<java.lang.String,java.lang.Object> getProps​()
        Returns all attached properties.
        Returns:
        All attached properties.