org.apache.commons.collections4.keyvalue

## Class AbstractMapEntryDecorator<K,V>

- java.lang.Object
- - org.apache.commons.collections4.keyvalue.AbstractMapEntryDecorator<K,V>

- All Implemented Interfaces:
    Map.Entry<K,V>, KeyValue<K,V>
  Direct Known Subclasses:
    AbstractDualBidiMap.MapEntry

      public abstract class AbstractMapEntryDecorator<K,V>
      extends Object
      implements Map.Entry<K,V>, KeyValue<K,V>

  Provides a base decorator that allows additional functionality to be added to a `Map.Entry`.
  Since:
    3.0
  Version:
    $Id: AbstractMapEntryDecorator.java 1686855 2015-06-22 13:00:27Z tn $

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractMapEntryDecorator(Map.Entry<K,V> entry)` Constructor that wraps (not copies).

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object object)`
    `K` | `getKey()` Gets the key from the pair.
    `protected Map.Entry<K,V>` | `getMapEntry()` Gets the map being decorated.
    `V` | `getValue()` Gets the value from the pair.
    `int` | `hashCode()`
    `V` | `setValue(V object)`
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### AbstractMapEntryDecorator

          public AbstractMapEntryDecorator(Map.Entry<K,V> entry)

      Constructor that wraps (not copies).
      Parameters:
        `entry` - the `Map.Entry` to decorate, must not be null
      Throws:
        `NullPointerException` - if the collection is null

  - ### Method Detail

    - #### getMapEntry

          protected Map.Entry<K,V> getMapEntry()

      Gets the map being decorated.
      Returns:
        the decorated map

    - #### getKey

          public K getKey()

      Description copied from interface: `KeyValue`
      Gets the key from the pair.
      Specified by:
        `getKey` in interface `Map.Entry<K,V>`
      Specified by:
        `getKey` in interface `KeyValue<K,V>`
      Returns:
        the key

    - #### getValue

          public V getValue()

      Description copied from interface: `KeyValue`
      Gets the value from the pair.
      Specified by:
        `getValue` in interface `Map.Entry<K,V>`
      Specified by:
        `getValue` in interface `KeyValue<K,V>`
      Returns:
        the value

    - #### setValue

          public V setValue(V object)

      Specified by:
        `setValue` in interface `Map.Entry<K,V>`

    - #### equals

          public boolean equals(Object object)

      Specified by:
        `equals` in interface `Map.Entry<K,V>`
      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Specified by:
        `hashCode` in interface `Map.Entry<K,V>`
      Overrides:
        `hashCode` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2001–2015 The Apache Software Foundation. All rights reserved.