@GwtIncompatible abstract class ImmutableSortedMultisetFauxverideShim<E> extends ImmutableMultiset<E>
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.
ImmutableMultiset.Builder<E>, ImmutableMultiset.ElementSet<E>, ImmutableMultiset.EntrySetSerializedForm<E>, ImmutableMultiset.SerializedForm
Multiset.Entry<E>
SPLITERATOR_CHARACTERISTICS
Constructor and Description |
---|
ImmutableSortedMultisetFauxverideShim() |
Modifier and Type | Method and Description |
---|---|
static <E> ImmutableSortedMultiset.Builder<E> |
builder()
Deprecated.
Use
ImmutableSortedMultiset.naturalOrder() , which offers better type-safety. |
static <E> ImmutableSortedMultiset<E> |
copyOf(E[] elements)
Deprecated.
Pass parameters of type
Comparable to use ImmutableSortedMultiset.copyOf(Comparable[]) . |
static <E> ImmutableSortedMultiset<E> |
of(E element)
Deprecated.
Pass a parameter of type
Comparable to use ImmutableSortedMultiset.of(Comparable) . |
static <E> ImmutableSortedMultiset<E> |
of(E e1,
E e2)
Deprecated.
Pass the parameters of type
Comparable to use ImmutableSortedMultiset.of(Comparable, Comparable) . |
static <E> ImmutableSortedMultiset<E> |
of(E e1,
E e2,
E e3)
Deprecated.
Pass the parameters of type
Comparable to use ImmutableSortedMultiset.of(Comparable, Comparable, Comparable) . |
static <E> ImmutableSortedMultiset<E> |
of(E e1,
E e2,
E e3,
E e4)
Deprecated.
Pass the parameters of type
Comparable to use ImmutableSortedMultiset.of(Comparable, Comparable, Comparable, Comparable) . |
static <E> ImmutableSortedMultiset<E> |
of(E e1,
E e2,
E e3,
E e4,
E e5)
Deprecated.
Pass the parameters of type
Comparable to use ImmutableSortedMultiset.of(Comparable, Comparable, Comparable, Comparable, Comparable) .
|
static <E> ImmutableSortedMultiset<E> |
of(E e1,
E e2,
E e3,
E e4,
E e5,
E e6,
E... remaining)
Deprecated.
Pass the parameters of type
Comparable to use ImmutableSortedMultiset.of(Comparable, Comparable, Comparable, Comparable, Comparable,
Comparable, Comparable...) . |
static <E> java.util.stream.Collector<E,?,ImmutableMultiset<E>> |
toImmutableMultiset()
|
static <T,E> java.util.stream.Collector<T,?,ImmutableMultiset<E>> |
toImmutableMultiset(java.util.function.Function<? super T,? extends E> elementFunction,
java.util.function.ToIntFunction<? super T> countFunction)
|
add, asList, contains, copyFromEntries, copyIntoArray, copyOf, copyOf, elementSet, entrySet, equals, getEntry, hashCode, iterator, of, remove, setCount, setCount, toString, writeReplace
add, addAll, clear, isPartialView, remove, removeAll, removeIf, retainAll, spliterator, toArray, toArray
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
add, containsAll, count, forEach, forEachEntry, remove, removeAll, retainAll, size, spliterator
@Deprecated public static <E> java.util.stream.Collector<E,?,ImmutableMultiset<E>> toImmutableMultiset()
ImmutableSortedMultiset.toImmutableSortedMultiset(java.util.Comparator<? super E>)
instead. This
method exists only to hide ImmutableMultiset.toImmutableMultiset()
from consumers of
ImmutableSortedMultiset
.java.lang.UnsupportedOperationException
- always@Deprecated public static <T,E> java.util.stream.Collector<T,?,ImmutableMultiset<E>> toImmutableMultiset(java.util.function.Function<? super T,? extends E> elementFunction, java.util.function.ToIntFunction<? super T> countFunction)
ImmutableSortedMultiset.toImmutableSortedMultiset(java.util.Comparator<? super E>)
instead. This
method exists only to hide ImmutableMultiset.toImmutableMultiset()
from consumers of
ImmutableSortedMultiset
.java.lang.UnsupportedOperationException
- always@Deprecated public static <E> ImmutableSortedMultiset.Builder<E> builder()
ImmutableSortedMultiset.naturalOrder()
, which offers better type-safety.ImmutableSortedMultiset.naturalOrder()
, which offers better
type-safety, instead. This method exists only to hide ImmutableMultiset.builder()
from
consumers of ImmutableSortedMultiset
.java.lang.UnsupportedOperationException
- always@Deprecated public static <E> ImmutableSortedMultiset<E> of(E element)
Comparable
to use ImmutableSortedMultiset.of(Comparable)
.Comparable
element. Proper calls will resolve to the version in ImmutableSortedMultiset
, not this dummy version.java.lang.UnsupportedOperationException
- always@Deprecated public static <E> ImmutableSortedMultiset<E> of(E e1, E e2)
Comparable
to use ImmutableSortedMultiset.of(Comparable, Comparable)
.Comparable
element. Proper calls will resolve to the version in ImmutableSortedMultiset
, not this dummy version.java.lang.UnsupportedOperationException
- always@Deprecated public static <E> ImmutableSortedMultiset<E> of(E e1, E e2, E e3)
Comparable
to use ImmutableSortedMultiset.of(Comparable, Comparable, Comparable)
.Comparable
element. Proper calls will resolve to the version in ImmutableSortedMultiset
, not this dummy version.java.lang.UnsupportedOperationException
- always@Deprecated public static <E> ImmutableSortedMultiset<E> of(E e1, E e2, E e3, E e4)
Comparable
to use ImmutableSortedMultiset.of(Comparable, Comparable, Comparable, Comparable)
. Comparable
element. Proper calls will resolve to the version in ImmutableSortedMultiset
, not this dummy version.java.lang.UnsupportedOperationException
- always@Deprecated public static <E> ImmutableSortedMultiset<E> of(E e1, E e2, E e3, E e4, E e5)
Comparable
to use ImmutableSortedMultiset.of(Comparable, Comparable, Comparable, Comparable, Comparable)
.
Comparable
element. Proper calls will resolve to the version in ImmutableSortedMultiset
, not this dummy version.java.lang.UnsupportedOperationException
- always@Deprecated public static <E> ImmutableSortedMultiset<E> of(E e1, E e2, E e3, E e4, E e5, E e6, E... remaining)
Comparable
to use ImmutableSortedMultiset.of(Comparable, Comparable, Comparable, Comparable, Comparable,
Comparable, Comparable...)
. Comparable
element. Proper calls will resolve to the version in ImmutableSortedMultiset
, not this dummy version.java.lang.UnsupportedOperationException
- always@Deprecated public static <E> ImmutableSortedMultiset<E> copyOf(E[] elements)
Comparable
to use ImmutableSortedMultiset.copyOf(Comparable[])
.Comparable
elements. Proper calls will resolve to the version in ImmutableSortedMultiset
, not this dummy version.java.lang.UnsupportedOperationException
- always