Package org.apache.commons.chain.web
Class MapEntry
- java.lang.Object
-
- org.apache.commons.chain.web.MapEntry
-
- All Implemented Interfaces:
java.util.Map.Entry
public class MapEntry extends java.lang.Object implements java.util.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 Summary
Fields Modifier and Type Field Description private java.lang.Object
key
The entry key.private boolean
modifiable
Whether the entry can be modified.private java.lang.Object
value
The entry value.
-
Constructor Summary
Constructors Constructor Description MapEntry(java.lang.Object key, java.lang.Object 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 Description boolean
equals(java.lang.Object o)
Determines if this entry is equal to the passed object.java.lang.Object
getKey()
Gets the entry key.java.lang.Object
getValue()
Gets the entry value.int
hashCode()
Returns the hashcode for this entry.java.lang.Object
setValue(java.lang.Object val)
Sets the entry value if the entry can be modified.
-
-
-
Method Detail
-
getKey
public java.lang.Object getKey()
Gets the entry key.
- Specified by:
getKey
in interfacejava.util.Map.Entry
- Returns:
- The entry key
-
getValue
public java.lang.Object getValue()
Gets the entry value.
- Specified by:
getValue
in interfacejava.util.Map.Entry
- Returns:
- The entry key
-
setValue
public java.lang.Object setValue(java.lang.Object val)
Sets the entry value if the entry can be modified.
- Specified by:
setValue
in interfacejava.util.Map.Entry
- Parameters:
val
- The new value- Returns:
- The old entry value
- Throws:
java.lang.UnsupportedOperationException
- If the entry cannot be modified
-
equals
public boolean equals(java.lang.Object o)
Determines if this entry is equal to the passed object.
- Specified by:
equals
in interfacejava.util.Map.Entry
- Overrides:
equals
in classjava.lang.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 interfacejava.util.Map.Entry
- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- The and'ed hashcode of the key and value
-
-