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