java.util.Map.Entry
, KeyValue
, Unmodifiable
public final class UnmodifiableMapEntry extends AbstractMapEntry implements Unmodifiable
Map.Entry
that throws
UnsupportedOperationException when setValue
is called.key, value
Constructor | Description |
---|---|
UnmodifiableMapEntry(java.lang.Object key,
java.lang.Object value) |
Constructs a new entry with the specified key and given value.
|
UnmodifiableMapEntry(java.util.Map.Entry entry) |
Constructs a new entry from the specified
Map.Entry . |
UnmodifiableMapEntry(KeyValue pair) |
Constructs a new entry from the specified
KeyValue . |
Modifier and Type | Method | Description |
---|---|---|
java.lang.Object |
setValue(java.lang.Object value) |
Throws UnsupportedOperationException.
|
getKey, getValue, toString
equals, hashCode
public UnmodifiableMapEntry(java.lang.Object key, java.lang.Object value)
key
- the key for the entry, may be nullvalue
- the value for the entry, may be nullpublic UnmodifiableMapEntry(KeyValue pair)
KeyValue
.pair
- the pair to copy, must not be nulljava.lang.NullPointerException
- if the entry is nullpublic UnmodifiableMapEntry(java.util.Map.Entry entry)
Map.Entry
.entry
- the entry to copy, must not be nulljava.lang.NullPointerException
- if the entry is nullpublic java.lang.Object setValue(java.lang.Object value)
setValue
in interface java.util.Map.Entry
setValue
in class AbstractMapEntry
value
- the new valuejava.lang.UnsupportedOperationException
- alwaysCopyright © 2001-2017 Apache Software Foundation. All Rights Reserved.