public final class ImmutableSet<E> extends Object implements Set<E>, Serializable
Modifier and Type | Class and Description |
---|---|
static class |
ImmutableSet.Builder<E> |
Constructor and Description |
---|
ImmutableSet(Collection<E> collection) |
ImmutableSet(E... elements) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(E object) |
boolean |
addAll(Collection<? extends E> collection) |
void |
clear() |
boolean |
contains(Object object) |
boolean |
containsAll(Collection<?> collection) |
static <T> ImmutableSet<T> |
empty() |
boolean |
isEmpty() |
Iterator<E> |
iterator() |
boolean |
remove(Object object) |
boolean |
removeAll(Collection<?> collection) |
boolean |
retainAll(Collection<?> collection) |
int |
size() |
Object[] |
toArray() |
<T> T[] |
toArray(T[] array) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
equals, hashCode, spliterator
parallelStream, removeIf, stream
@SafeVarargs public ImmutableSet(E... elements)
public ImmutableSet(@NonNull Collection<E> collection)
@NonNull public static <T> ImmutableSet<T> empty()
public boolean add(E object)
public boolean addAll(@NonNull Collection<? extends E> collection)
public void clear()
public boolean contains(Object object)
public boolean containsAll(@NonNull Collection<?> collection)
containsAll
in interface Collection<E>
containsAll
in interface Set<E>
public boolean isEmpty()
public boolean remove(Object object)
public boolean removeAll(@NonNull Collection<?> collection)
public boolean retainAll(@NonNull Collection<?> collection)
public int size()
@NonNull public Object[] toArray()