org.apache.tiles.request.collection

## 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 and Description
    `MapEntry(K key, V value, boolean modifiable)` Creates a map entry that can either allow modifications or not.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object o)` Determines if this entry is equal to the passed object.
    `K` | `getKey()` Gets the entry key.
    `V` | `getValue()` Gets the entry value.
    `int` | `hashCode()` Returns the hashcode for this entry.
    `V` | `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`

    - ### Methods inherited from interface java.util.Map.Entry

      `comparingByKey, comparingByKey, comparingByValue, comparingByValue`

- - ### Constructor Detail

    - #### 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 Detail

    - #### 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

Copyright © 2000–2025 Apache Software Foundation. All rights reserved.