Top Description Constructors Methods
com.google.common.collect

pack-priv abstract Class ImmutableSortedMultisetFauxverideShim<E>

extends ImmutableMultiset<E>
Class Inheritance
Known Direct Subclasses
com.google.common.collect.ImmutableSortedMultiset
Annotations
@GwtIncompatible
@ElementTypesAreNonnullByDefault
Imports
com.google.common.annotations.GwtIncompatible, com.google.errorprone.annotations.DoNotCall, java.util.function.Function, .ToIntFunction, java.util.stream.Collector, org.checkerframework.checker.nullness.qual.Nullable

"Overrides" the ImmutableMultiset static methods that lack ImmutableSortedMultiset equivalents with deprecated, exception-throwing versions. This prevents accidents like the following:
List<Object> objects = ...;
// Sort them:
Set<Object> sorted = ImmutableSortedMultiset.copyOf(objects);
// BAD CODE! The returned multiset is actually an unsorted ImmutableMultiset!

While we could put the overrides in ImmutableSortedMultiset itself, it seems clearer to separate these "do not call" methods from those intended for normal use.

Author
Louis Wasserman

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public static <E> ImmutableSortedMultiset.Builder<E>
builder()

Hides com.google.common.collect.ImmutableMultiset.builder.

Deprecated Use ImmutableSortedMultiset#naturalOrder, which offers better type-safety.
Not supported.
public static <E> ImmutableSortedMultiset<E>
copyOf(E[] elements)

Hides com.google.common.collect.ImmutableMultiset.copyOf.

Deprecated Pass parameters of type Comparable to use ImmutableSortedMultiset#copyOf(Comparable[]).
Not supported.
public static <E> ImmutableSortedMultiset<E>
of(E element)

Hides com.google.common.collect.ImmutableMultiset.of.

Deprecated Pass a parameter of type Comparable to use ImmutableSortedMultiset#of(Comparable).
Not supported.
public static <E> ImmutableSortedMultiset<E>
of(E e1, E e2)

Hides com.google.common.collect.ImmutableMultiset.of.

Deprecated Pass the parameters of type Comparable to use ImmutableSortedMultiset#of(Comparable, Comparable).
Not supported.
public static <E> ImmutableSortedMultiset<E>
of(E e1, E e2, E e3)

Hides com.google.common.collect.ImmutableMultiset.of.

Deprecated Pass the parameters of type Comparable to use ImmutableSortedMultiset#of(Comparable, Comparable, Comparable).
Not supported.
public static <E> ImmutableSortedMultiset<E>
of(E e1, E e2, E e3, E e4)

Hides com.google.common.collect.ImmutableMultiset.of.

Deprecated Pass the parameters of type Comparable to use ImmutableSortedMultiset#of(Comparable, Comparable, Comparable, Comparable).
Not supported.
public static <E> ImmutableSortedMultiset<E>
of(E e1, E e2, E e3, E e4, E e5)

Hides com.google.common.collect.ImmutableMultiset.of.

Deprecated Pass the parameters of type Comparable to use ImmutableSortedMultiset#of(Comparable, Comparable, Comparable, Comparable, Comparable) .
Not supported.
public static <E> ImmutableSortedMultiset<E>
of(E e1, E e2, E e3, E e4, E e5, E e6, E... remaining)

Hides com.google.common.collect.ImmutableMultiset.of.

Not supported.
public static <E> Collector<E, ?, ImmutableMultiset<E>>
public static <T extends @Nullable Object, E> Collector<T, ?, ImmutableMultiset<E>>
toImmutableMultiset(Function<? super T, ? extends E> elementFunction, ToIntFunction<? super T> countFunction)

Hides com.google.common.collect.ImmutableMultiset.toImmutableMultiset.

Not supported.
Inherited from com.google.common.collect.ImmutableMultiset:
addasListcontainscopyFromEntriescopyIntoArraycopyOfcopyOfelementSetentrySetequalsgetEntryhashCodeiteratorofremovesetCountsetCounttoStringwriteReplace

Constructor Detail

ImmutableSortedMultisetFauxverideShimback to summary
pack-priv ImmutableSortedMultisetFauxverideShim()

Method Detail

builderback to summary
public static <E> ImmutableSortedMultiset.Builder<E> builder()

Hides com.google.common.collect.ImmutableMultiset.builder.

Deprecated

Use ImmutableSortedMultiset#naturalOrder, which offers better type-safety.

Not supported. Use ImmutableSortedMultiset#naturalOrder, which offers better type-safety, instead. This method exists only to hide ImmutableMultiset#builder from consumers of ImmutableSortedMultiset.

Annotations
@DoNotCall:Use naturalOrder.
@Deprecated
Exceptions
UnsupportedOperationException:
always
copyOfback to summary
public static <E> ImmutableSortedMultiset<E> copyOf(E[] elements)

Hides com.google.common.collect.ImmutableMultiset.copyOf.

Deprecated

Pass parameters of type Comparable to use ImmutableSortedMultiset#copyOf(Comparable[]).

Not supported. You are attempting to create a multiset that may contain non-Comparable elements. Proper calls will resolve to the version in ImmutableSortedMultiset, not this dummy version.

Annotations
@DoNotCall:Elements must be Comparable. (Or, pass a Comparator to orderedBy or copyOf.)
@Deprecated
Exceptions
UnsupportedOperationException:
always
ofback to summary
public static <E> ImmutableSortedMultiset<E> of(E element)

Hides com.google.common.collect.ImmutableMultiset.of.

Deprecated

Pass a parameter of type Comparable to use ImmutableSortedMultiset#of(Comparable).

Not supported. You are attempting to create a multiset that may contain a non-Comparable element. Proper calls will resolve to the version in ImmutableSortedMultiset, not this dummy version.

Annotations
@DoNotCall:Elements must be Comparable. (Or, pass a Comparator to orderedBy or copyOf.)
@Deprecated
Exceptions
UnsupportedOperationException:
always
ofback to summary
public static <E> ImmutableSortedMultiset<E> of(E e1, E e2)

Hides com.google.common.collect.ImmutableMultiset.of.

Deprecated

Pass the parameters of type Comparable to use ImmutableSortedMultiset#of(Comparable, Comparable).

Not supported. You are attempting to create a multiset that may contain a non-Comparable element. Proper calls will resolve to the version in ImmutableSortedMultiset, not this dummy version.

Annotations
@DoNotCall:Elements must be Comparable. (Or, pass a Comparator to orderedBy or copyOf.)
@Deprecated
Exceptions
UnsupportedOperationException:
always
ofback to summary
public static <E> ImmutableSortedMultiset<E> of(E e1, E e2, E e3)

Hides com.google.common.collect.ImmutableMultiset.of.

Deprecated

Pass the parameters of type Comparable to use ImmutableSortedMultiset#of(Comparable, Comparable, Comparable).

Not supported. You are attempting to create a multiset that may contain a non-Comparable element. Proper calls will resolve to the version in ImmutableSortedMultiset, not this dummy version.

Annotations
@DoNotCall:Elements must be Comparable. (Or, pass a Comparator to orderedBy or copyOf.)
@Deprecated
Exceptions
UnsupportedOperationException:
always
ofback to summary
public static <E> ImmutableSortedMultiset<E> of(E e1, E e2, E e3, E e4)

Hides com.google.common.collect.ImmutableMultiset.of.

Deprecated

Pass the parameters of type Comparable to use ImmutableSortedMultiset#of(Comparable, Comparable, Comparable, Comparable).

Not supported. You are attempting to create a multiset that may contain a non-Comparable element. Proper calls will resolve to the version in ImmutableSortedMultiset, not this dummy version.

Annotations
@DoNotCall:Elements must be Comparable. (Or, pass a Comparator to orderedBy or copyOf.)
@Deprecated
Exceptions
UnsupportedOperationException:
always
ofback to summary
public static <E> ImmutableSortedMultiset<E> of(E e1, E e2, E e3, E e4, E e5)

Hides com.google.common.collect.ImmutableMultiset.of.

Deprecated

Pass the parameters of type Comparable to use ImmutableSortedMultiset#of(Comparable, Comparable, Comparable, Comparable, Comparable) .

Not supported. You are attempting to create a multiset that may contain a non-Comparable element. Proper calls will resolve to the version in ImmutableSortedMultiset, not this dummy version.

Annotations
@DoNotCall:Elements must be Comparable. (Or, pass a Comparator to orderedBy or copyOf.)
@Deprecated
Exceptions
UnsupportedOperationException:
always
ofback to summary
public static <E> ImmutableSortedMultiset<E> of(E e1, E e2, E e3, E e4, E e5, E e6, E... remaining)

Hides com.google.common.collect.ImmutableMultiset.of.

Not supported. You are attempting to create a multiset that may contain a non-Comparable element. Proper calls will resolve to the version in ImmutableSortedMultiset, not this dummy version.

Annotations
@DoNotCall:Elements must be Comparable. (Or, pass a Comparator to orderedBy or copyOf.)
@Deprecated
Exceptions
UnsupportedOperationException:
always
toImmutableMultisetback to summary
public static <E> Collector<E, ?, ImmutableMultiset<E>> toImmutableMultiset()

Hides com.google.common.collect.ImmutableMultiset.toImmutableMultiset.

Not supported. Use ImmutableSortedMultiset#toImmutableSortedMultiset instead. This method exists only to hide ImmutableMultiset#toImmutableMultiset from consumers of ImmutableSortedMultiset.

Annotations
@DoNotCall:Use toImmutableSortedMultiset.
@Deprecated
Exceptions
UnsupportedOperationException:
always
Since
21.0
toImmutableMultisetback to summary
public static <T extends @Nullable Object, E> Collector<T, ?, ImmutableMultiset<E>> toImmutableMultiset(Function<? super T, ? extends E> elementFunction, ToIntFunction<? super T> countFunction)

Hides com.google.common.collect.ImmutableMultiset.toImmutableMultiset.

Not supported. Use ImmutableSortedMultiset#toImmutableSortedMultiset instead. This method exists only to hide ImmutableMultiset#toImmutableMultiset from consumers of ImmutableSortedMultiset.

Annotations
@DoNotCall:Use toImmutableSortedMultiset.
@Deprecated
Exceptions
UnsupportedOperationException:
always
Since
22.0