Top Description Constructors Methods
org.apache.commons.collections4.keyvalue

public final Class UnmodifiableMapEntry<K, V>

extends AbstractMapEntry<K, V>
implements Unmodifiable
Class Inheritance
All Implemented Interfaces
org.apache.commons.collections4.Unmodifiable
Type Parameters
<K>
the type of keys
<V>
the type of mapped values
Imports
java.util.Map, org.apache.commons.collections4.KeyValue, .Unmodifiable

A Map.Entry that throws UnsupportedOperationException when setValue is called.
Since
3.0

Constructor Summary

AccessConstructor and Description
public
UnmodifiableMapEntry(final K
the key for the entry, may be null
key
,
final V
the value for the entry, may be null
value
)

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

public
UnmodifiableMapEntry(final KeyValue<? extends K, ? extends V>
the pair to copy, must not be null
pair
)

Constructs a new entry from the specified KeyValue.

public
UnmodifiableMapEntry(final Map.Entry<? extends K, ? extends V>
the entry to copy, must not be null
entry
)

Constructs a new entry from the specified Map.Entry.

Method Summary

Modifier and TypeMethod and Description
public V

Returns:

the previous value
setValue
(final V
the new value
value
)

Overrides org.apache.commons.collections4.keyvalue.AbstractMapEntry.setValue.

Implements java.util.Map.Entry.setValue.

Throws UnsupportedOperationException.
Inherited from org.apache.commons.collections4.keyvalue.AbstractMapEntry:
equalshashCode

Constructor Detail

UnmodifiableMapEntryback to summary
public UnmodifiableMapEntry(final K key, final V value)

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

Parameters
key:K

the key for the entry, may be null

value:V

the value for the entry, may be null

UnmodifiableMapEntryback to summary
public UnmodifiableMapEntry(final KeyValue<? extends K, ? extends V> pair)

Constructs a new entry from the specified KeyValue.

Parameters
pair:KeyValue<? extends K, ? extends V>

the pair to copy, must not be null

Exceptions
NullPointerException:
if the entry is null
UnmodifiableMapEntryback to summary
public UnmodifiableMapEntry(final Map.Entry<? extends K, ? extends V> entry)

Constructs a new entry from the specified Map.Entry.

Parameters
entry:Map.Entry<? extends K, ? extends V>

the entry to copy, must not be null

Exceptions
NullPointerException:
if the entry is null

Method Detail

setValueback to summary
public V setValue(final V value)

Overrides org.apache.commons.collections4.keyvalue.AbstractMapEntry.setValue.

Implements java.util.Map.Entry.setValue.

Throws UnsupportedOperationException.

Parameters
value:V

the new value

Returns:V

the previous value

Annotations
@Override
Exceptions
UnsupportedOperationException:
always