public final class UnmodifiableSet<E> extends AbstractSerializableSetDecorator<E> implements Unmodifiable
Set to ensure it can't be altered.
This class is Serializable from Commons Collections 3.1.
Attempts to modify it will result in an UnsupportedOperationException.
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(E object)
|
boolean |
addAll(Collection
|
void |
clear()
|
Iterator |
iterator()
|
boolean |
remove(Object
|
boolean |
removeAll(Collection
|
boolean |
retainAll(Collection
|
static <E> Set |
unmodifiableSet(Set
Factory method to create an unmodifiable set.
|
decorated, equals, hashCodecontains, containsAll, isEmpty, setCollection, size, toArray, toArray, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitcontains, containsAll, isEmpty, size, spliterator, toArray, toArrayparallelStream, removeIf, streampublic static <E> Set<E> unmodifiableSet(Set <? extends E> set)
E - the element type
set - the set to decorate, must not be null
NullPointerException - if set is null
public boolean add(E object)
public boolean addAll(Collection<? extends E> coll)
public void clear()
public boolean remove(Objectobject)
public boolean removeAll(Collection<?> coll)
public boolean retainAll(Collection<?> coll)