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.EntrySetSerializedForm<E>
ImmutableCollection.ArrayBasedBuilder<E>
Multiset.Entry<E>
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...) . |
add, contains, containsAll, copyFromEntries, copyIntoArray, copyOf, copyOf, entrySet, equals, getEntry, hashCode, iterator, of, remove, setCount, setCount, toString, writeReplace
add, addAll, asList, clear, createAsList, isPartialView, remove, removeAll, retainAll, toArray, toArray
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
add, count, elementSet, remove, removeAll, retainAll
@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