Example usage for java.util AbstractMap.SimpleImmutableEntry equals

List of usage examples for java.util AbstractMap.SimpleImmutableEntry equals

Introduction

In this page you can find the example usage for java.util AbstractMap.SimpleImmutableEntry equals.

Prototype

public boolean equals(Object o) 

Source Link

Document

Compares the specified object with this map for equality.

Usage

From source file:org.alfresco.repo.cache.DefaultSimpleCache.java

/**
 * <code>put</code> method that may be used to check for updates in a thread-safe manner.
 * //from ww w . j  a v  a2s  .  c om
 * @return <code>true</code> if the put resulted in a change in value, <code>false</code> otherwise.
 */
public boolean putAndCheckUpdate(K key, V value) {
    AbstractMap.SimpleImmutableEntry<K, V> kvp = new AbstractMap.SimpleImmutableEntry<K, V>(key, value);
    AbstractMap.SimpleImmutableEntry<K, V> priorKVP = map.put(key, kvp);
    return priorKVP != null && (!priorKVP.equals(kvp));
}