public final class UnmodifiableSet
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static <E> java.util.Set<E> |
copyOf(java.util.Iterator<? extends E> elementsIterator)
Returns an unmodifiable view of the set created from the given elements.
|
static <E> java.util.Set<E> |
of(E... elements)
Returns an unmodifiable view of the set created from the given elements.
|
public static <E> java.util.Set<E> of(E... elements)
E - type of the elementselements - Array of elementspublic static <E> java.util.Set<E> copyOf(java.util.Iterator<? extends E> elementsIterator)
E - type of the elementselementsIterator - iterator to get the elements of the set.