Kieker 1.9

kieker.common.util
Class ImmutableEntry<K,V>

java.lang.Object
  extended by 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.
 
Method Summary
 boolean equals(Object obj)
           
 K getKey()
           
 V getValue()
           
 int hashCode()
           
 V setValue(V v)
          This method is not supported, as the entry is immutable.
 String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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.
Method Detail

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

Kieker 1.9

Copyright 2014 Kieker Project, http://kieker-monitoring.net