001package com.identityworksllc.iiq.common;
002
003import java.util.Map;
004import java.util.concurrent.ConcurrentMap;
005
006/**
007 * An interface extending {@link DelegatedMap} to implement {@link ConcurrentMap}
008 * methods. All method calls will be delegated to the return value of {@link #getDelegate()}.
009 *
010 * @param <K>
011 * @param <V>
012 */
013public interface DelegatedConcurrentMap<K, V> extends ConcurrentMap<K, V>, DelegatedMap<K, V> {
014    /**
015     * Gets the map to which all other {@link Map} calls are delegated
016     * @return The Map to which all calls are delegated
017     */
018    @Override
019    ConcurrentMap<K, V> getDelegate();
020
021    default V putIfAbsent(K key, V value) {
022        return getDelegate().putIfAbsent(key, value);
023    }
024
025    default boolean remove(Object key, Object value) {
026        return getDelegate().remove(key, value);
027    }
028
029    default boolean replace(K key, V oldValue, V newValue) {
030        return getDelegate().replace(key, oldValue, newValue);
031    }
032
033    default V replace(K key, V value) {
034        return getDelegate().replace(key, value);
035    }
036}