aboutsummaryrefslogtreecommitdiff
path: root/guava/src/com/google/common/collect/ImmutableSortedMultiset.java
diff options
context:
space:
mode:
authorSadaf Ebrahimi <sadafebrahimi@google.com>2024-01-03 17:59:28 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2024-01-03 17:59:28 +0000
commit422eb80feae2e73eda9678ecaacbd087d4b7020b (patch)
treecbc7e4894708533a0ddc4e61da1d74e64393e0e1 /guava/src/com/google/common/collect/ImmutableSortedMultiset.java
parenteec82bd5ace8fd2c4ba647f153c4c03e1bb41268 (diff)
parent0be00b5218b69852777cab76ff89457211904bc9 (diff)
downloadguava-422eb80feae2e73eda9678ecaacbd087d4b7020b.tar.gz
Merge "Upgrade guava to v33.0.0" into main am: fcb6827395 am: 0be00b5218
Original change: https://android-review.googlesource.com/c/platform/external/guava/+/2894060 Change-Id: I8deb731e9d2b4cc35b6760f190c9e7583e91b271 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'guava/src/com/google/common/collect/ImmutableSortedMultiset.java')
-rw-r--r--guava/src/com/google/common/collect/ImmutableSortedMultiset.java160
1 files changed, 159 insertions, 1 deletions
diff --git a/guava/src/com/google/common/collect/ImmutableSortedMultiset.java b/guava/src/com/google/common/collect/ImmutableSortedMultiset.java
index d2991bce9..454a77569 100644
--- a/guava/src/com/google/common/collect/ImmutableSortedMultiset.java
+++ b/guava/src/com/google/common/collect/ImmutableSortedMultiset.java
@@ -55,7 +55,7 @@ import org.checkerframework.checker.nullness.qual.Nullable;
*/
@GwtIncompatible // hasn't been tested yet
@ElementTypesAreNonnullByDefault
-public abstract class ImmutableSortedMultiset<E> extends ImmutableSortedMultisetFauxverideShim<E>
+public abstract class ImmutableSortedMultiset<E> extends ImmutableMultiset<E>
implements SortedMultiset<E> {
// TODO(lowasser): GWT compatibility
@@ -606,4 +606,162 @@ public abstract class ImmutableSortedMultiset<E> extends ImmutableSortedMultiset
private void readObject(ObjectInputStream stream) throws InvalidObjectException {
throw new InvalidObjectException("Use SerializedForm");
}
+
+ /**
+ * Not supported. Use {@link #toImmutableSortedMultiset} instead. This method exists only to hide
+ * {@link ImmutableMultiset#toImmutableMultiset} from consumers of {@code
+ * ImmutableSortedMultiset}.
+ *
+ * @throws UnsupportedOperationException always
+ * @deprecated Use {@link ImmutableSortedMultiset#toImmutableSortedMultiset}.
+ * @since 21.0
+ */
+ @DoNotCall("Use toImmutableSortedMultiset.")
+ @Deprecated
+ public static <E> Collector<E, ?, ImmutableMultiset<E>> toImmutableMultiset() {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Not supported. Use {@link #toImmutableSortedMultiset} instead. This method exists only to hide
+ * {@link ImmutableMultiset#toImmutableMultiset} from consumers of {@code
+ * ImmutableSortedMultiset}.
+ *
+ * @throws UnsupportedOperationException always
+ * @deprecated Use {@link ImmutableSortedMultiset#toImmutableSortedMultiset}.
+ * @since 22.0
+ */
+ @DoNotCall("Use toImmutableSortedMultiset.")
+ @Deprecated
+ public static <T extends @Nullable Object, E>
+ Collector<T, ?, ImmutableMultiset<E>> toImmutableMultiset(
+ Function<? super T, ? extends E> elementFunction,
+ ToIntFunction<? super T> countFunction) {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Not supported. Use {@link #naturalOrder}, which offers better type-safety, instead. This method
+ * exists only to hide {@link ImmutableMultiset#builder} from consumers of {@code
+ * ImmutableSortedMultiset}.
+ *
+ * @throws UnsupportedOperationException always
+ * @deprecated Use {@link ImmutableSortedMultiset#naturalOrder}, which offers better type-safety.
+ */
+ @DoNotCall("Use naturalOrder.")
+ @Deprecated
+ public static <E> ImmutableSortedMultiset.Builder<E> builder() {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Not supported. <b>You are attempting to create a multiset that may contain a non-{@code
+ * Comparable} element.</b> Proper calls will resolve to the version in {@code
+ * ImmutableSortedMultiset}, not this dummy version.
+ *
+ * @throws UnsupportedOperationException always
+ * @deprecated <b>Pass a parameter of type {@code Comparable} to use {@link
+ * ImmutableSortedMultiset#of(Comparable)}.</b>
+ */
+ @DoNotCall("Elements must be Comparable. (Or, pass a Comparator to orderedBy or copyOf.)")
+ @Deprecated
+ public static <E> ImmutableSortedMultiset<E> of(E element) {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Not supported. <b>You are attempting to create a multiset that may contain a non-{@code
+ * Comparable} element.</b> Proper calls will resolve to the version in {@code
+ * ImmutableSortedMultiset}, not this dummy version.
+ *
+ * @throws UnsupportedOperationException always
+ * @deprecated <b>Pass the parameters of type {@code Comparable} to use {@link
+ * ImmutableSortedMultiset#of(Comparable, Comparable)}.</b>
+ */
+ @DoNotCall("Elements must be Comparable. (Or, pass a Comparator to orderedBy or copyOf.)")
+ @Deprecated
+ public static <E> ImmutableSortedMultiset<E> of(E e1, E e2) {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Not supported. <b>You are attempting to create a multiset that may contain a non-{@code
+ * Comparable} element.</b> Proper calls will resolve to the version in {@code
+ * ImmutableSortedMultiset}, not this dummy version.
+ *
+ * @throws UnsupportedOperationException always
+ * @deprecated <b>Pass the parameters of type {@code Comparable} to use {@link
+ * ImmutableSortedMultiset#of(Comparable, Comparable, Comparable)}.</b>
+ */
+ @DoNotCall("Elements must be Comparable. (Or, pass a Comparator to orderedBy or copyOf.)")
+ @Deprecated
+ public static <E> ImmutableSortedMultiset<E> of(E e1, E e2, E e3) {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Not supported. <b>You are attempting to create a multiset that may contain a non-{@code
+ * Comparable} element.</b> Proper calls will resolve to the version in {@code
+ * ImmutableSortedMultiset}, not this dummy version.
+ *
+ * @throws UnsupportedOperationException always
+ * @deprecated <b>Pass the parameters of type {@code Comparable} to use {@link
+ * ImmutableSortedMultiset#of(Comparable, Comparable, Comparable, Comparable)}. </b>
+ */
+ @DoNotCall("Elements must be Comparable. (Or, pass a Comparator to orderedBy or copyOf.)")
+ @Deprecated
+ public static <E> ImmutableSortedMultiset<E> of(E e1, E e2, E e3, E e4) {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Not supported. <b>You are attempting to create a multiset that may contain a non-{@code
+ * Comparable} element.</b> Proper calls will resolve to the version in {@code
+ * ImmutableSortedMultiset}, not this dummy version.
+ *
+ * @throws UnsupportedOperationException always
+ * @deprecated <b>Pass the parameters of type {@code Comparable} to use {@link
+ * ImmutableSortedMultiset#of(Comparable, Comparable, Comparable, Comparable, Comparable)} .
+ * </b>
+ */
+ @DoNotCall("Elements must be Comparable. (Or, pass a Comparator to orderedBy or copyOf.)")
+ @Deprecated
+ public static <E> ImmutableSortedMultiset<E> of(E e1, E e2, E e3, E e4, E e5) {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Not supported. <b>You are attempting to create a multiset that may contain a non-{@code
+ * Comparable} element.</b> Proper calls will resolve to the version in {@code
+ * ImmutableSortedMultiset}, not this dummy version.
+ *
+ * @throws UnsupportedOperationException always
+ * @deprecated <b>Pass the parameters of type {@code Comparable} to use {@link
+ * ImmutableSortedMultiset#of(Comparable, Comparable, Comparable, Comparable, Comparable,
+ * Comparable, Comparable...)} . </b>
+ */
+ @DoNotCall("Elements must be Comparable. (Or, pass a Comparator to orderedBy or copyOf.)")
+ @Deprecated
+ public static <E> ImmutableSortedMultiset<E> of(
+ E e1, E e2, E e3, E e4, E e5, E e6, E... remaining) {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Not supported. <b>You are attempting to create a multiset that may contain non-{@code
+ * Comparable} elements.</b> Proper calls will resolve to the version in {@code
+ * ImmutableSortedMultiset}, not this dummy version.
+ *
+ * @throws UnsupportedOperationException always
+ * @deprecated <b>Pass parameters of type {@code Comparable} to use {@link
+ * ImmutableSortedMultiset#copyOf(Comparable[])}.</b>
+ */
+ @DoNotCall("Elements must be Comparable. (Or, pass a Comparator to orderedBy or copyOf.)")
+ @Deprecated
+ // The usage of "Z" here works around bugs in Javadoc (JDK-8318093) and JDiff.
+ public static <Z> ImmutableSortedMultiset<Z> copyOf(Z[] elements) {
+ throw new UnsupportedOperationException();
+ }
+
+ private static final long serialVersionUID = 0xcafebabe;
}