diff options
Diffstat (limited to 'guava/src/com/google/common/collect/ImmutableBiMap.java')
-rw-r--r-- | guava/src/com/google/common/collect/ImmutableBiMap.java | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/guava/src/com/google/common/collect/ImmutableBiMap.java b/guava/src/com/google/common/collect/ImmutableBiMap.java index c0d3ed715..f1777e62e 100644 --- a/guava/src/com/google/common/collect/ImmutableBiMap.java +++ b/guava/src/com/google/common/collect/ImmutableBiMap.java @@ -30,6 +30,7 @@ import java.io.ObjectInputStream; import java.util.Arrays; import java.util.Comparator; import java.util.Map; +import java.util.function.BinaryOperator; import java.util.function.Function; import java.util.stream.Collector; import java.util.stream.Collectors; @@ -45,8 +46,7 @@ import org.checkerframework.checker.nullness.qual.Nullable; */ @GwtCompatible(serializable = true, emulated = true) @ElementTypesAreNonnullByDefault -public abstract class ImmutableBiMap<K, V> extends ImmutableBiMapFauxverideShim<K, V> - implements BiMap<K, V> { +public abstract class ImmutableBiMap<K, V> extends ImmutableMap<K, V> implements BiMap<K, V> { /** * Returns a {@link Collector} that accumulates elements into an {@code ImmutableBiMap} whose keys @@ -642,4 +642,40 @@ public abstract class ImmutableBiMap<K, V> extends ImmutableBiMapFauxverideShim< private void readObject(ObjectInputStream stream) throws InvalidObjectException { throw new InvalidObjectException("Use SerializedForm"); } + + /** + * Not supported. Use {@link #toImmutableBiMap} instead. This method exists only to hide {@link + * ImmutableMap#toImmutableMap(Function, Function)} from consumers of {@code ImmutableBiMap}. + * + * @throws UnsupportedOperationException always + * @deprecated Use {@link ImmutableBiMap#toImmutableBiMap}. + */ + @Deprecated + @DoNotCall("Use toImmutableBiMap") + public static <T extends @Nullable Object, K, V> + Collector<T, ?, ImmutableMap<K, V>> toImmutableMap( + Function<? super T, ? extends K> keyFunction, + Function<? super T, ? extends V> valueFunction) { + throw new UnsupportedOperationException(); + } + + /** + * Not supported. This method does not make sense for {@code BiMap}. This method exists only to + * hide {@link ImmutableMap#toImmutableMap(Function, Function, BinaryOperator)} from consumers of + * {@code ImmutableBiMap}. + * + * @throws UnsupportedOperationException always + * @deprecated + */ + @Deprecated + @DoNotCall("Use toImmutableBiMap") + public static <T extends @Nullable Object, K, V> + Collector<T, ?, ImmutableMap<K, V>> toImmutableMap( + Function<? super T, ? extends K> keyFunction, + Function<? super T, ? extends V> valueFunction, + BinaryOperator<V> mergeFunction) { + throw new UnsupportedOperationException(); + } + + private static final long serialVersionUID = 0xcafebabe; } |