Module lettuce.core

Class LettuceSets

java.lang.Object
io.lettuce.core.internal.LettuceSets

public final class LettuceSets
extends Object
Static utility methods for Set instances. This class is part of the internal API and may change without further notice.
Since:
4.2
Author:
Mark Paluch
  • Method Details

    • newHashSet

      public static <T> Set<T> newHashSet​(Collection<? extends T> elements)
      Creates a new HashSet containing all elements from elements.
      Type Parameters:
      T - the element type
      Parameters:
      elements - the elements that the set should contain, must not be null.
      Returns:
      a new HashSet containing all elements from elements.
    • newHashSet

      public static <T> Set<T> newHashSet​(Iterable<? extends T> elements)
      Creates a new HashSet containing all elements from elements.
      Type Parameters:
      T - the element type
      Parameters:
      elements - the elements that the set should contain, must not be null.
      Returns:
      a new HashSet containing all elements from elements.
    • newHashSet

      @SafeVarargs public static <T> Set<T> newHashSet​(T... elements)
      Creates a new HashSet containing all elements from elements.
      Type Parameters:
      T - the element type
      Parameters:
      elements - the elements that the set should contain, must not be null.
      Returns:
      a new HashSet containing all elements from elements.
    • unmodifiableSet

      @SafeVarargs public static <T> Set<T> unmodifiableSet​(T... elements)
      Creates a new unmodifiable HashSet containing all elements from elements.
      Type Parameters:
      T - the element type
      Parameters:
      elements - the elements that the set should contain, must not be null.
      Returns:
      a new HashSet containing all elements from elements.