Class AbstractMapEntryDecorator

  • All Implemented Interfaces:
    java.util.Map.Entry, KeyValue
    Direct Known Subclasses:
    AbstractDualBidiMap.MapEntry

    public abstract class AbstractMapEntryDecorator
    extends java.lang.Object
    implements java.util.Map.Entry, KeyValue
    Provides a base decorator that allows additional functionality to be added to a Map.Entry.
    Since:
    Commons Collections 3.0
    Version:
    $Revision: 646777 $ $Date: 2008-04-10 14:33:15 +0200 (Thu, 10 Apr 2008) $
    Author:
    Stephen Colebourne
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.Map.Entry entry
      The Map.Entry to decorate
    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractMapEntryDecorator​(java.util.Map.Entry entry)
      Constructor that wraps (not copies).
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object object)  
      java.lang.Object getKey()
      Gets the key from the pair.
      protected java.util.Map.Entry getMapEntry()
      Gets the map being decorated.
      java.lang.Object getValue()
      Gets the value from the pair.
      int hashCode()  
      java.lang.Object setValue​(java.lang.Object object)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • entry

        protected final java.util.Map.Entry entry
        The Map.Entry to decorate
    • Constructor Detail

      • AbstractMapEntryDecorator

        public AbstractMapEntryDecorator​(java.util.Map.Entry entry)
        Constructor that wraps (not copies).
        Parameters:
        entry - the Map.Entry to decorate, must not be null
        Throws:
        java.lang.IllegalArgumentException - if the collection is null
    • Method Detail

      • getMapEntry

        protected java.util.Map.Entry getMapEntry()
        Gets the map being decorated.
        Returns:
        the decorated map
      • getKey

        public java.lang.Object getKey()
        Description copied from interface: KeyValue
        Gets the key from the pair.
        Specified by:
        getKey in interface KeyValue
        Specified by:
        getKey in interface java.util.Map.Entry
        Returns:
        the key
      • getValue

        public java.lang.Object getValue()
        Description copied from interface: KeyValue
        Gets the value from the pair.
        Specified by:
        getValue in interface KeyValue
        Specified by:
        getValue in interface java.util.Map.Entry
        Returns:
        the value
      • setValue

        public java.lang.Object setValue​(java.lang.Object object)
        Specified by:
        setValue in interface java.util.Map.Entry
      • equals

        public boolean equals​(java.lang.Object object)
        Specified by:
        equals in interface java.util.Map.Entry
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface java.util.Map.Entry
        Overrides:
        hashCode in class java.lang.Object
      • toString

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