java.lang.Object
net.luis.utils.collection.util.SimpleEntry<K,V>
- Type Parameters:
K
- The type of the keyV
- The type of the value
- All Implemented Interfaces:
Map.Entry<K,
V>
- Direct Known Subclasses:
MutableEntry
A simple immutable implementation of the
Map.Entry
interface.- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSimpleEntry
(K key, V value) Constructs a new simple entry with the specified key and value. -
Method Summary
-
Field Details
-
key
The key of the entry. -
value
The value of the entry.
-
-
Constructor Details
-
SimpleEntry
Constructs a new simple entry with the specified key and value.- Parameters:
key
- The key of the entryvalue
- The value of the entry- Throws:
NullPointerException
- If the key is null
-
-
Method Details
-
getKey
-
getValue
-
setValue
Throws aModificationException
because the entry is immutable.- Specified by:
setValue
in interfaceMap.Entry<K,
V> - Parameters:
value
- The new value of the entry (ignored)- Returns:
- Nothing, because an exception is thrown
- Throws:
ModificationException
- Always
-
equals
-
hashCode
public int hashCode() -
toString
-