| Modifier and Type | Method and Description |
|---|---|
static <E> Set<E> |
newHashSet(Collection<? extends E> elements)
Creates a new
HashSet containing all elements from elements. |
static <E> Set<E> |
newHashSet(E... elements)
Creates a new
HashSet containing all elements from elements. |
static <E> Set<E> |
newHashSet(Iterable<? extends E> elements)
Creates a new
HashSet containing all elements from elements. |
static <K> Set<K> |
unmodifiableSet(K... elements)
Creates a new unmodifiable
HashSet containing all elements from elements. |
public static <E> Set<E> newHashSet(Collection<? extends E> elements)
HashSet containing all elements from elements.elements - the elements that the set should contain, must not be null.HashSet containing all elements from elements.public static <E> Set<E> newHashSet(Iterable<? extends E> elements)
HashSet containing all elements from elements.elements - the elements that the set should contain, must not be null.HashSet containing all elements from elements.public static <E> Set<E> newHashSet(E... elements)
HashSet containing all elements from elements.elements - the elements that the set should contain, must not be null.HashSet containing all elements from elements.public static <K> Set<K> unmodifiableSet(K... elements)
HashSet containing all elements from elements.elements - the elements that the set should contain, must not be null.HashSet containing all elements from elements.Copyright © 2016. All rights reserved.