⇒ Index (Frames) |  ⇒ Index (No Frames) |  ⇒ Package |  ⇒ Package Tree |  ⇒ Full Tree 
org.apache.commons.collections.keyvalue

Class UnmodifiableMapEntry

java.lang.Object
|
+--org.apache.commons.collections.keyvalue.AbstractKeyValue
   |
   +--org.apache.commons.collections.keyvalue.AbstractMapEntry
      |
      +--org.apache.commons.collections.keyvalue.UnmodifiableMapEntry

All Implemented Interfaces:
Map.Entry, KeyValue, Unmodifiable


public final class UnmodifiableMapEntry
extends AbstractMapEntry
implements Unmodifiable

A java.util.Map.Entry that throws UnsupportedOperationException when setValue is called.
Since:
Commons Collections 3.0
Author:
Stephen Colebourne

Constructor Summary

UnmodifiableMapEntry(final Object key, final Object value)

Constructs a new entry with the specified key and given value.

UnmodifiableMapEntry(final KeyValue pair)

Constructs a new entry from the specified KeyValue.

UnmodifiableMapEntry(final Map.Entry entry)

Constructs a new entry from the specified MapEntry.

Method Summary

Object

setValue(Object value)

Throws UnsupportedOperationException.

Constructor Details

UnmodifiableMapEntry

public UnmodifiableMapEntry(final KeyValue pair)

Constructs a new entry from the specified KeyValue.

Parameters:
pair - the pair to copy, must not be null
Throws:
- if the entry is null

UnmodifiableMapEntry

public UnmodifiableMapEntry(final Map.Entry entry)

Constructs a new entry from the specified MapEntry.

Parameters:
entry - the entry to copy, must not be null
Throws:
- if the entry is null

UnmodifiableMapEntry

public UnmodifiableMapEntry(final Object key, final Object value)

Constructs a new entry with the specified key and given value.

Parameters:
key - the key for the entry, may be null
value - the value for the entry, may be null

Method Details

setValue

public Object setValue(Object value)

Throws UnsupportedOperationException.

Parameters:
value - the new value
Returns:
the previous value
Throws:
- always