org.elasticsearch.util.collect
Class ForwardingMapEntry<K,V>

java.lang.Object
  extended by org.elasticsearch.util.collect.ForwardingObject
      extended by org.elasticsearch.util.collect.ForwardingMapEntry<K,V>
All Implemented Interfaces:
java.util.Map.Entry<K,V>

public abstract class ForwardingMapEntry<K,V>
extends ForwardingObject
implements java.util.Map.Entry<K,V>

A map entry which forwards all its method calls to another map entry. Subclasses should override one or more methods to modify the behavior of the backing map entry as desired per the decorator pattern.

See Also:
ForwardingObject

Constructor Summary
ForwardingMapEntry()
           
 
Method Summary
protected abstract  java.util.Map.Entry<K,V> delegate()
          Returns the backing delegate instance that methods are forwarded to.
 boolean equals(java.lang.Object object)
           
 K getKey()
           
 V getValue()
           
 int hashCode()
           
 V setValue(V value)
           
 
Methods inherited from class org.elasticsearch.util.collect.ForwardingObject
toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ForwardingMapEntry

public ForwardingMapEntry()
Method Detail

delegate

protected abstract java.util.Map.Entry<K,V> delegate()
Description copied from class: ForwardingObject
Returns the backing delegate instance that methods are forwarded to. Abstract subclasses generally override this method with an abstract method that has a more specific return type, such as ForwardingSet.delegate(). Concrete subclasses override this method to supply the instance being decorated.

Specified by:
delegate in class ForwardingObject

getKey

public K getKey()
Specified by:
getKey in interface java.util.Map.Entry<K,V>

getValue

public V getValue()
Specified by:
getValue in interface java.util.Map.Entry<K,V>

setValue

public V setValue(V value)
Specified by:
setValue in interface java.util.Map.Entry<K,V>

equals

public boolean equals(@Nullable
                      java.lang.Object object)
Specified by:
equals in interface java.util.Map.Entry<K,V>
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Specified by:
hashCode in interface java.util.Map.Entry<K,V>
Overrides:
hashCode in class java.lang.Object