Class MapEntry<K,V>

java.lang.Object
org.apache.tiles.request.collection.MapEntry<K,V>
Type Parameters:
K - The key type.
V - The value type.
All Implemented Interfaces:
Map.Entry<K,V>
Direct Known Subclasses:
MapEntryArrayValues

public class MapEntry<K,V> extends Object implements Map.Entry<K,V>

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

  • Constructor Summary

    Constructors
    Constructor
    Description
    MapEntry(K key, V value, boolean modifiable)
    Creates a map entry that can either allow modifications or not.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Determines if this entry is equal to the passed object.
    Gets the entry key.
    Gets the entry value.
    int
    Returns the hashcode for this entry.
    setValue(V val)
    Sets the entry value if the entry can be modified.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MapEntry

      public MapEntry(K key, V 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 K getKey()

      Gets the entry key.

      Specified by:
      getKey in interface Map.Entry<K,V>
      Returns:
      The entry key
    • getValue

      public V getValue()

      Gets the entry value.

      Specified by:
      getValue in interface Map.Entry<K,V>
      Returns:
      The entry key
    • setValue

      public V setValue(V val)

      Sets the entry value if the entry can be modified.

      Specified by:
      setValue in interface Map.Entry<K,V>
      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<K,V>
      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<K,V>
      Overrides:
      hashCode in class Object
      Returns:
      The and'ed hashcode of the key and value