001/*
002 * Copyright (C) 2010 The Guava Authors
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016
017package com.google.common.collect;
018
019import com.google.common.annotations.GwtCompatible;
020import com.google.errorprone.annotations.CanIgnoreReturnValue;
021import java.util.Map.Entry;
022import java.util.Set;
023import javax.annotation.Nullable;
024
025/**
026 * A set multimap which forwards all its method calls to another set multimap.
027 * Subclasses should override one or more methods to modify the behavior of
028 * the backing multimap as desired per the <a
029 * href="http://en.wikipedia.org/wiki/Decorator_pattern">decorator pattern</a>.
030 *
031 * @author Kurt Alfred Kluever
032 * @since 3.0
033 */
034@GwtCompatible
035public abstract class ForwardingSetMultimap<K, V> extends ForwardingMultimap<K, V>
036    implements SetMultimap<K, V> {
037
038  @Override
039  protected abstract SetMultimap<K, V> delegate();
040
041  @Override
042  public Set<Entry<K, V>> entries() {
043    return delegate().entries();
044  }
045
046  @Override
047  public Set<V> get(@Nullable K key) {
048    return delegate().get(key);
049  }
050
051  @CanIgnoreReturnValue
052  @Override
053  public Set<V> removeAll(@Nullable Object key) {
054    return delegate().removeAll(key);
055  }
056
057  @CanIgnoreReturnValue
058  @Override
059  public Set<V> replaceValues(K key, Iterable<? extends V> values) {
060    return delegate().replaceValues(key, values);
061  }
062}