Class SimpleEntry<T>

  • All Implemented Interfaces:
    java.util.Map.Entry<T,​T>

    public class SimpleEntry<T>
    extends java.lang.Object
    implements java.util.Map.Entry<T,​T>
    Straight forward implementation of Map.Entry.
    Note: Does not support null keys.
    Author:
    Markus von RĂ¼den
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)
      Returns the result of this.key.equals(that.key) && this.value.equals(that.value).
      T getKey()  
      T getValue()  
      int hashCode()  
      T setValue​(T value)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • SimpleEntry

        public SimpleEntry​(T key)
      • SimpleEntry

        public SimpleEntry​(T key,
                           T value)
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getKey

        public T getKey()
        Specified by:
        getKey in interface java.util.Map.Entry<T,​T>
      • getValue

        public T getValue()
        Specified by:
        getValue in interface java.util.Map.Entry<T,​T>
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface java.util.Map.Entry<T,​T>
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Returns the result of this.key.equals(that.key) && this.value.equals(that.value).
        Specified by:
        equals in interface java.util.Map.Entry<T,​T>
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj -
        Returns:
        true if both keys and values are equal, false otherwise. False is also returned if obj does not inherit/implement Entry does not match or obj is null.
      • setValue

        public T setValue​(T value)
        Specified by:
        setValue in interface java.util.Map.Entry<T,​T>