Class MapEntry

java.lang.Object
org.apache.commons.chain.web.MapEntry
All Implemented Interfaces:
Map.Entry

public class MapEntry extends Object implements Map.Entry

Map.Entry implementation that can be constructed to either be read-only or not.

Version:
$Revision: 480477 $ $Date: 2006-11-29 08:34:52 +0000 (Wed, 29 Nov 2006) $
  • Field Details

    • key

      private Object key

      The entry key.

    • value

      private Object value

      The entry value.

    • modifiable

      private boolean modifiable

      Whether the entry can be modified.

  • Constructor Details

    • MapEntry

      public MapEntry(Object key, Object value, boolean modifiable)

      Creates a map entry that can either allow modifications or not.

      Parameters:
      key - The entry key
      value - The entry value
      modifiable - Whether the entry should allow modification or not
  • Method Details

    • getKey

      public Object getKey()

      Gets the entry key.

      Specified by:
      getKey in interface Map.Entry
      Returns:
      The entry key
    • getValue

      public Object getValue()

      Gets the entry value.

      Specified by:
      getValue in interface Map.Entry
      Returns:
      The entry key
    • setValue

      public Object setValue(Object val)

      Sets the entry value if the entry can be modified.

      Specified by:
      setValue in interface Map.Entry
      Parameters:
      val - The new value
      Returns:
      The old entry value
      Throws:
      UnsupportedOperationException - If the entry cannot be modified
    • equals

      public boolean equals(Object o)

      Determines if this entry is equal to the passed object.

      Specified by:
      equals in interface Map.Entry
      Overrides:
      equals in class Object
      Parameters:
      o - The object to test
      Returns:
      True if equal, else false
    • hashCode

      public int hashCode()

      Returns the hashcode for this entry.

      Specified by:
      hashCode in interface Map.Entry
      Overrides:
      hashCode in class Object
      Returns:
      The and'ed hashcode of the key and value