Package io.lettuce.core.internal
Class LettuceSets
- java.lang.Object
-
- io.lettuce.core.internal.LettuceSets
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> Set<T>
newHashSet(Iterable<? extends T> elements)
Creates a newHashSet
containing all elements fromelements
.static <T> Set<T>
newHashSet(Collection<? extends T> elements)
Creates a newHashSet
containing all elements fromelements
.static <T> Set<T>
newHashSet(T... elements)
Creates a newHashSet
containing all elements fromelements
.static <T> Set<T>
unmodifiableSet(T... elements)
Creates a new unmodifiableHashSet
containing all elements fromelements
.
-
-
-
Method Detail
-
newHashSet
public static <T> Set<T> newHashSet(Collection<? extends T> elements)
Creates a newHashSet
containing all elements fromelements
.- Type Parameters:
T
- the element type- Parameters:
elements
- the elements that the set should contain, must not benull
.- Returns:
- a new
HashSet
containing all elements fromelements
.
-
newHashSet
public static <T> Set<T> newHashSet(Iterable<? extends T> elements)
Creates a newHashSet
containing all elements fromelements
.- Type Parameters:
T
- the element type- Parameters:
elements
- the elements that the set should contain, must not benull
.- Returns:
- a new
HashSet
containing all elements fromelements
.
-
newHashSet
@SafeVarargs public static <T> Set<T> newHashSet(T... elements)
Creates a newHashSet
containing all elements fromelements
.- Type Parameters:
T
- the element type- Parameters:
elements
- the elements that the set should contain, must not benull
.- Returns:
- a new
HashSet
containing all elements fromelements
.
-
unmodifiableSet
@SafeVarargs public static <T> Set<T> unmodifiableSet(T... elements)
Creates a new unmodifiableHashSet
containing all elements fromelements
.- Type Parameters:
T
- the element type- Parameters:
elements
- the elements that the set should contain, must not benull
.- Returns:
- a new
HashSet
containing all elements fromelements
.
-
-