E - Element typepublic class ImmutableNullableSet<E> extends AbstractSet<E>
If the set cannot contain null values, use ImmutableSet.
We do not yet support sorted sets.
| Modifier and Type | Class and Description |
|---|---|
static class |
ImmutableNullableSet.Builder<E>
A builder for creating immutable nullable set instances.
|
| Modifier and Type | Method and Description |
|---|---|
static <E> ImmutableNullableSet.Builder<E> |
builder()
Returns a new builder.
|
boolean |
contains(@Nullable Object o) |
static <E> Set<E> |
copyOf(E[] elements)
Returns an immutable set containing the given elements.
|
static <E> Set<E> |
copyOf(Iterable<? extends E> elements)
Returns an immutable set containing the given elements.
|
Iterator<E> |
iterator() |
static <E> Set<E> |
of(E e1)
Creates an immutable set of 1 element.
|
static <E> Set<E> |
of(E e1,
E e2)
Creates an immutable set of 2 elements.
|
static <E> Set<E> |
of(E e1,
E e2,
E e3)
Creates an immutable set of 3 elements.
|
static <E> Set<E> |
of(E e1,
E e2,
E e3,
E e4)
Creates an immutable set of 4 elements.
|
static <E> Set<E> |
of(E e1,
E e2,
E e3,
E e4,
E e5,
E... others)
Creates an immutable set of 5 or more elements.
|
boolean |
remove(@Nullable Object o) |
boolean |
removeAll(Collection<?> c) |
int |
size() |
equals, hashCodeadd, addAll, clear, containsAll, isEmpty, retainAll, toArray, toArray, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitadd, addAll, clear, containsAll, isEmpty, retainAll, spliterator, toArray, toArrayparallelStream, removeIf, streampublic int size()
size in interface Collection<E>size in interface Set<E>size in class AbstractCollection<E>public boolean contains(@Nullable Object o)
contains in interface Collection<E>contains in interface Set<E>contains in class AbstractCollection<E>public boolean remove(@Nullable Object o)
remove in interface Collection<E>remove in interface Set<E>remove in class AbstractCollection<E>public boolean removeAll(Collection<?> c)
removeAll in interface Collection<E>removeAll in interface Set<E>removeAll in class AbstractSet<E>public static <E> Set<E> copyOf(Iterable<? extends E> elements)
Behavior is as ImmutableSet.copyOf(Iterable)
except that this set allows nulls.
public static <E> Set<E> copyOf(E[] elements)
Behavior as
ImmutableSet.copyOf(Object[])
except that this set allows nulls.
public static <E> Set<E> of(E e1)
public static <E> Set<E> of(E e1, E e2)
public static <E> Set<E> of(E e1, E e2, E e3)
public static <E> Set<E> of(E e1, E e2, E e3, E e4)
public static <E> Set<E> of(E e1, E e2, E e3, E e4, E e5, E... others)
public static <E> ImmutableNullableSet.Builder<E> builder()
ImmutableNullableSet.Builder constructor.Copyright © 2012-2022 Apache Software Foundation. All Rights Reserved.