@GwtIncompatible abstract class ImmutableSortedSetFauxverideShim<E> extends ImmutableSet<E>
ImmutableSet static methods that lack
ImmutableSortedSet equivalents with deprecated, exception-throwing
versions. This prevents accidents like the following:
List<Object> objects = ...;
// Sort them:
Set<Object> sorted = ImmutableSortedSet.copyOf(objects);
// BAD CODE! The returned set is actually an unsorted ImmutableSet!
While we could put the overrides in ImmutableSortedSet itself, it
seems clearer to separate these "do not call" methods from those intended for
normal use.
ImmutableSet.Builder<E>, ImmutableSet.Indexed<E>ImmutableCollection.ArrayBasedBuilder<E>MAX_TABLE_SIZE| Constructor and Description |
|---|
ImmutableSortedSetFauxverideShim() |
| Modifier and Type | Method and Description |
|---|---|
static <E> ImmutableSortedSet.Builder<E> |
builder()
Deprecated.
Use
ImmutableSortedSet.naturalOrder(), which offers
better type-safety. |
static <E> ImmutableSortedSet<E> |
copyOf(E[] elements)
Deprecated.
Pass parameters of type
Comparable to use ImmutableSortedSet.copyOf(Comparable[]). |
static <E> ImmutableSortedSet<E> |
of(E element)
Deprecated.
Pass a parameter of type
Comparable to use ImmutableSortedSet.of(Comparable). |
static <E> ImmutableSortedSet<E> |
of(E e1,
E e2)
Deprecated.
Pass the parameters of type
Comparable to use ImmutableSortedSet.of(Comparable, Comparable). |
static <E> ImmutableSortedSet<E> |
of(E e1,
E e2,
E e3)
Deprecated.
Pass the parameters of type
Comparable to use ImmutableSortedSet.of(Comparable, Comparable, Comparable). |
static <E> ImmutableSortedSet<E> |
of(E e1,
E e2,
E e3,
E e4)
Deprecated.
Pass the parameters of type
Comparable to use ImmutableSortedSet.of(Comparable, Comparable, Comparable, Comparable).
|
static <E> ImmutableSortedSet<E> |
of(E e1,
E e2,
E e3,
E e4,
E e5)
Deprecated.
Pass the parameters of type
Comparable to use ImmutableSortedSet.of(
Comparable, Comparable, Comparable, Comparable, Comparable). |
static <E> ImmutableSortedSet<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 ImmutableSortedSet.of(Comparable, Comparable, Comparable, Comparable,
Comparable, Comparable, Comparable...). |
asList, chooseTableSize, copyOf, copyOf, copyOf, createAsList, equals, hashCode, isHashCodeFast, iterator, of, writeReplaceadd, addAll, clear, contains, copyIntoArray, isPartialView, remove, removeAll, retainAll, toArray, toArrayclone, finalize, getClass, notify, notifyAll, wait, wait, wait@Deprecated public static <E> ImmutableSortedSet.Builder<E> builder()
ImmutableSortedSet.naturalOrder(), which offers
better type-safety.ImmutableSortedSet.naturalOrder(), which offers
better type-safety, instead. This method exists only to hide
ImmutableSet.builder() from consumers of ImmutableSortedSet.java.lang.UnsupportedOperationException - always@Deprecated public static <E> ImmutableSortedSet<E> of(E element)
Comparable to use ImmutableSortedSet.of(Comparable).Comparable element. Proper calls will resolve to the
version in ImmutableSortedSet, not this dummy version.java.lang.UnsupportedOperationException - always@Deprecated public static <E> ImmutableSortedSet<E> of(E e1, E e2)
Comparable to use ImmutableSortedSet.of(Comparable, Comparable).Comparable element. Proper calls will resolve to the
version in ImmutableSortedSet, not this dummy version.java.lang.UnsupportedOperationException - always@Deprecated public static <E> ImmutableSortedSet<E> of(E e1, E e2, E e3)
Comparable to use ImmutableSortedSet.of(Comparable, Comparable, Comparable).Comparable element. Proper calls will resolve to the
version in ImmutableSortedSet, not this dummy version.java.lang.UnsupportedOperationException - always@Deprecated public static <E> ImmutableSortedSet<E> of(E e1, E e2, E e3, E e4)
Comparable to use ImmutableSortedSet.of(Comparable, Comparable, Comparable, Comparable).
Comparable element. Proper calls will resolve to the
version in ImmutableSortedSet, not this dummy version.java.lang.UnsupportedOperationException - always@Deprecated public static <E> ImmutableSortedSet<E> of(E e1, E e2, E e3, E e4, E e5)
Comparable to use ImmutableSortedSet.of(
Comparable, Comparable, Comparable, Comparable, Comparable). Comparable element. Proper calls will resolve to the
version in ImmutableSortedSet, not this dummy version.java.lang.UnsupportedOperationException - always@Deprecated public static <E> ImmutableSortedSet<E> of(E e1, E e2, E e3, E e4, E e5, E e6, E... remaining)
Comparable to use ImmutableSortedSet.of(Comparable, Comparable, Comparable, Comparable,
Comparable, Comparable, Comparable...). Comparable element. Proper calls will resolve to the
version in ImmutableSortedSet, not this dummy version.java.lang.UnsupportedOperationException - always@Deprecated public static <E> ImmutableSortedSet<E> copyOf(E[] elements)
Comparable to use ImmutableSortedSet.copyOf(Comparable[]).Comparable elements. Proper calls will resolve to the
version in ImmutableSortedSet, not this dummy version.java.lang.UnsupportedOperationException - always