kieker.common.util
Class ImmutableEntry<K,V>
java.lang.Object
kieker.common.util.ImmutableEntry<K,V>
- Type Parameters:
K
- The type of the key.V
- The type of the value.
- All Implemented Interfaces:
- Map.Entry<K,V>
public class ImmutableEntry<K,V>
- extends Object
- implements Map.Entry<K,V>
Java's SimpleImmutableEntry, as in implementation of Map.Entry
, is available for Java 1.6 or higher.
Hence, we provide our own implementation here.
- Since:
- 1.6
- Author:
- Andre van Hoorn
Constructor Summary |
ImmutableEntry(K key,
V value)
Creates a new instance of this class using the given parameters. |
ImmutableEntry
public ImmutableEntry(K key,
V value)
- Creates a new instance of this class using the given parameters.
- Parameters:
key
- The key to be stored in the entry.value
- The valeu to be stored in the entry.
getKey
public K getKey()
- Specified by:
getKey
in interface Map.Entry<K,V>
getValue
public V getValue()
- Specified by:
getValue
in interface Map.Entry<K,V>
setValue
public V setValue(V v)
- This method is not supported, as the entry is immutable.
- Specified by:
setValue
in interface Map.Entry<K,V>
- Parameters:
v
- The argument. It will be ignored.
- Returns:
- Nothing. The method throws an exception.
hashCode
public int hashCode()
- Specified by:
hashCode
in interface Map.Entry<K,V>
- Overrides:
hashCode
in class Object
equals
public boolean equals(Object obj)
- Specified by:
equals
in interface Map.Entry<K,V>
- Overrides:
equals
in class Object
toString
public String toString()
- Overrides:
toString
in class Object
Copyright 2014 Kieker Project, http://kieker-monitoring.net>