public class ImmutableCollections
Modifier and Type | Method and Description |
---|---|
static <E> ImmutableSet<E> |
immutableHashSetOf()
Returns a shared empty set. The returned set is serializable.
|
static <E> ImmutableSet<E> |
immutableHashSetOf(E element)
Returns a singleton set. The returned set is serializable.
|
static <E> ImmutableSet<E> |
immutableHashSetOf(E elements)
Returns an immutable hash set of given elements. The returned set is serializable.
|
static <E> ImmutableList<E> |
immutableListOf()
Returns a shared empty list. The returned list is serializable.
|
static <E> ImmutableList<E> |
immutableListOf(E element)
Returns a singleton list. The returned list is serializable.
|
static <E> ImmutableList<E> |
immutableListOf(E elements)
Returns a list of given elements. The returned list is serializable.
|
static <E> ImmutableNavigableSet<E> |
immutableNavigableSetOf(E elements)
Returns an immutable navigable set of given elements. All elements inserted into a sorted set must implement the Comparable interface.
|
static <E> ImmutableNavigableSet<E> |
immutableNavigableSetOf(java.util.Comparator<? super E> comparator,
E elements)
Returns an immutable navigable set of given elements. All elements are will be sorted by the given comparator.
|
static <E> ImmutableSet<E> |
immutableSetOf()
Returns a shared empty set. The returned set is serializable.
|
static <E> ImmutableSet<E> |
immutableSetOf(E element)
Returns a singleton set. The returned set is serializable.
|
static <E> ImmutableSet<E> |
immutableSetOf(E elements)
Returns a set of given elements. Elements of the set are iterated in the order they were specified.
The returned set is serializable.
|
static <E> ImmutableSortedSet<E> |
immutableSortedSetOf(E elements)
Returns an immutable sorted set of given elements. All elements inserted into a sorted set must implement the Comparable interface.
|
static <E> ImmutableSortedSet<E> |
immutableSortedSetOf(java.util.Comparator<? super E> comparator,
E elements)
Returns an immutable sorted set of given elements. All elements are will be sorted by the given comparator.
|
static <E> ImmutableSet<E> |
toImmutableHashSet(java.util.Collection<? extends E> $receiver)
Returns an immutable hash set of all elements. The returned set is serializable.
|
static <E> ImmutableSet<E> |
toImmutableHashSet(java.lang.Iterable<? extends E> $receiver)
Returns an immutable hash set of all elements. The returned set is serializable.
|
static <E> ImmutableSet<E> |
toImmutableHashSet(kotlin.sequences.Sequence<? extends E> $receiver)
Returns an immutable hash set of all elements. The returned set is serializable.
|
static <E> ImmutableSet<E> |
toImmutableHashSet(E[] $receiver)
Returns an immutable hash set of all elements. The returned set is serializable.
|
static <E> ImmutableList<E> |
toImmutableList(java.util.Collection<? extends E> $receiver)
Returns a
interface ImmutableList containing all the elements. The returned list is serializable. |
static <E> ImmutableList<E> |
toImmutableList(java.lang.Iterable<? extends E> $receiver)
Returns a list containing all the elements. The returned list is serializable.
|
static <E> ImmutableList<E> |
toImmutableList(kotlin.sequences.Sequence<? extends E> $receiver)
Returns a list containing all the elements. The returned list is serializable.
|
static <E> ImmutableList<E> |
toImmutableList(E[] $receiver)
Returns a list containing all the elements. The returned list is serializable.
|
static <E> ImmutableNavigableSet<E> |
toImmutableNavigableSet(java.lang.Iterable<? extends E> $receiver,
java.util.Comparator<? super E> comparator)
Returns an immutable navigable set of all elements. The returned set is serializable.
|
static <E> ImmutableNavigableSet<E> |
toImmutableNavigableSet(java.util.SortedSet<E> $receiver)
Returns an immutable navigable set of all elements. The returned set is serializable.
|
static <E> ImmutableNavigableSet<E> |
toImmutableNavigableSet(ImmutableSortedSet<E> $receiver)
Returns an immutable navigable set of all elements. The returned set is serializable.
|
static <E> ImmutableNavigableSet<E> |
toImmutableNavigableSet(kotlin.sequences.Sequence<? extends E> $receiver,
java.util.Comparator<? super E> comparator)
Returns an immutable navigable set of all elements. The returned set is serializable.
|
static <E> ImmutableNavigableSet<E> |
toImmutableNavigableSet(E[] $receiver,
java.util.Comparator<? super E> comparator)
Returns an immutable navigable set of all elements. The returned set is serializable.
|
static <E> ImmutableSet<E> |
toImmutableSet(java.util.Collection<? extends E> $receiver)
Returns a Set of all elements. The returned set is serializable.
|
static <E> ImmutableSet<E> |
toImmutableSet(java.lang.Iterable<? extends E> $receiver)
Returns a Set of all elements. The returned set is serializable.
|
static <E> ImmutableSet<E> |
toImmutableSet(kotlin.sequences.Sequence<? extends E> $receiver)
Returns a Set of all elements. The returned set is serializable.
|
static <E> ImmutableSet<E> |
toImmutableSet(E[] $receiver)
Returns a Set of all elements. The returned set is serializable.
|
static <E> ImmutableSortedSet<E> |
toImmutableSortedSet(java.lang.Iterable<? extends E> $receiver,
java.util.Comparator<? super E> comparator)
Returns an immutable sorted set of all elements. The returned set is serializable.
|
static <E> ImmutableSortedSet<E> |
toImmutableSortedSet(java.util.SortedSet<E> $receiver)
Returns an immutable sorted set of all elements. The returned set is serializable.
|
static <E> ImmutableSortedSet<E> |
toImmutableSortedSet(kotlin.sequences.Sequence<? extends E> $receiver,
java.util.Comparator<? super E> comparator)
Returns an immutable sorted set of all elements. The returned set is serializable.
|
static <E> ImmutableSortedSet<E> |
toImmutableSortedSet(E[] $receiver,
java.util.Comparator<? super E> comparator)
Returns an immutable sorted set of all elements. The returned set is serializable.
|
public static <E> ImmutableList<E> immutableListOf()
Returns a shared empty list. The returned list is serializable.
public static <E> ImmutableList<E> immutableListOf(E element)
Returns a singleton list. The returned list is serializable.
public static <E> ImmutableList<E> immutableListOf(E elements)
Returns a list of given elements. The returned list is serializable.
public static <E> ImmutableSet<E> immutableSetOf()
Returns a shared empty set. The returned set is serializable.
public static <E> ImmutableSet<E> immutableSetOf(E element)
Returns a singleton set. The returned set is serializable.
public static <E> ImmutableSet<E> immutableSetOf(E elements)
Returns a set of given elements. Elements of the set are iterated in the order they were specified. The returned set is serializable.
public static <E> ImmutableSet<E> immutableHashSetOf()
Returns a shared empty set. The returned set is serializable.
public static <E> ImmutableSet<E> immutableHashSetOf(E element)
Returns a singleton set. The returned set is serializable.
public static <E> ImmutableSet<E> immutableHashSetOf(E elements)
Returns an immutable hash set of given elements. The returned set is serializable.
public static <E> ImmutableSortedSet<E> immutableSortedSetOf(E elements)
Returns an immutable sorted set of given elements. All elements inserted into a sorted set must implement the Comparable interface.
The returned set is serializable.
public static <E> ImmutableSortedSet<E> immutableSortedSetOf(java.util.Comparator<? super E> comparator, E elements)
Returns an immutable sorted set of given elements. All elements are will be sorted by the given comparator.
The returned set is serializable.
public static <E> ImmutableNavigableSet<E> immutableNavigableSetOf(E elements)
Returns an immutable navigable set of given elements. All elements inserted into a sorted set must implement the Comparable interface.
The returned set is serializable.
public static <E> ImmutableNavigableSet<E> immutableNavigableSetOf(java.util.Comparator<? super E> comparator, E elements)
Returns an immutable navigable set of given elements. All elements are will be sorted by the given comparator.
The returned set is serializable.
public static <E> ImmutableList<E> toImmutableList(java.util.Collection<? extends E> $receiver)
Returns a interface ImmutableList
containing all the elements. The returned list is serializable.
interface ImmutableList
public static <E> ImmutableList<E> toImmutableList(java.lang.Iterable<? extends E> $receiver)
Returns a list containing all the elements. The returned list is serializable.
public static <E> ImmutableList<E> toImmutableList(kotlin.sequences.Sequence<? extends E> $receiver)
Returns a list containing all the elements. The returned list is serializable.
This operation is terminal
public static <E> ImmutableList<E> toImmutableList(E[] $receiver)
Returns a list containing all the elements. The returned list is serializable.
public static <E> ImmutableSet<E> toImmutableSet(java.util.Collection<? extends E> $receiver)
Returns a Set of all elements. The returned set is serializable.
The returned set preserves the element iteration order of the original collection.
public static <E> ImmutableSet<E> toImmutableSet(java.lang.Iterable<? extends E> $receiver)
Returns a Set of all elements. The returned set is serializable.
The returned set preserves the element iteration order of the original collection.
public static <E> ImmutableSet<E> toImmutableSet(kotlin.sequences.Sequence<? extends E> $receiver)
Returns a Set of all elements. The returned set is serializable.
The returned set preserves the element iteration order of the original collection.
This operation is terminal
public static <E> ImmutableSet<E> toImmutableSet(E[] $receiver)
Returns a Set of all elements. The returned set is serializable.
The returned set preserves the element iteration order of the original collection.
public static <E> ImmutableSet<E> toImmutableHashSet(java.util.Collection<? extends E> $receiver)
Returns an immutable hash set of all elements. The returned set is serializable.
public static <E> ImmutableSet<E> toImmutableHashSet(java.lang.Iterable<? extends E> $receiver)
Returns an immutable hash set of all elements. The returned set is serializable.
public static <E> ImmutableSet<E> toImmutableHashSet(kotlin.sequences.Sequence<? extends E> $receiver)
Returns an immutable hash set of all elements. The returned set is serializable.
This operation is terminal
public static <E> ImmutableSet<E> toImmutableHashSet(E[] $receiver)
Returns an immutable hash set of all elements. The returned set is serializable.
public static <E> ImmutableSortedSet<E> toImmutableSortedSet(java.lang.Iterable<? extends E> $receiver, java.util.Comparator<? super E> comparator)
Returns an immutable sorted set of all elements. The returned set is serializable.
The elements will be sorted by the given comparator.
public static <E> ImmutableSortedSet<E> toImmutableSortedSet(java.util.SortedSet<E> $receiver)
Returns an immutable sorted set of all elements. The returned set is serializable.
The elements will be sorted by the given comparator.
public static <E> ImmutableSortedSet<E> toImmutableSortedSet(kotlin.sequences.Sequence<? extends E> $receiver, java.util.Comparator<? super E> comparator)
Returns an immutable sorted set of all elements. The returned set is serializable.
The elements will be sorted by the given comparator.
This operation is terminal
public static <E> ImmutableSortedSet<E> toImmutableSortedSet(E[] $receiver, java.util.Comparator<? super E> comparator)
Returns an immutable sorted set of all elements. The returned set is serializable.
The elements will be sorted by the given comparator.
public static <E> ImmutableNavigableSet<E> toImmutableNavigableSet(java.lang.Iterable<? extends E> $receiver, java.util.Comparator<? super E> comparator)
Returns an immutable navigable set of all elements. The returned set is serializable.
The elements will be sorted by the given comparator.
public static <E> ImmutableNavigableSet<E> toImmutableNavigableSet(java.util.SortedSet<E> $receiver)
Returns an immutable navigable set of all elements. The returned set is serializable.
The elements will be sorted by the given comparator.
public static <E> ImmutableNavigableSet<E> toImmutableNavigableSet(ImmutableSortedSet<E> $receiver)
Returns an immutable navigable set of all elements. The returned set is serializable.
The elements will be sorted by the given comparator.
public static <E> ImmutableNavigableSet<E> toImmutableNavigableSet(kotlin.sequences.Sequence<? extends E> $receiver, java.util.Comparator<? super E> comparator)
Returns an immutable navigable set of all elements. The returned set is serializable.
The elements will be sorted by the given comparator.
This operation is terminal
public static <E> ImmutableNavigableSet<E> toImmutableNavigableSet(E[] $receiver, java.util.Comparator<? super E> comparator)
Returns an immutable navigable set of all elements. The returned set is serializable.
The elements will be sorted by the given comparator.