Package io.microsphere.collection
Class SetUtils
- java.lang.Object
-
- io.microsphere.util.BaseUtils
-
- io.microsphere.collection.SetUtils
-
-
Constructor Summary
Constructors Constructor Description SetUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
isSet(java.lang.Iterable<?> elements)
static <E> java.util.Set<E>
newHashSet()
static <E> java.util.Set<E>
newHashSet(int initialCapacity)
static <E> java.util.Set<E>
newHashSet(int initialCapacity, float loadFactor)
static <E> java.util.Set<E>
newHashSet(java.lang.Iterable<E> elements)
static <E> java.util.Set<E>
newHashSet(java.util.Collection<? extends E> elements)
static <E> java.util.Set<E>
newLinkedHashSet()
static <E> java.util.Set<E>
newLinkedHashSet(int initialCapacity)
static <E> java.util.Set<E>
newLinkedHashSet(int initialCapacity, float loadFactor)
static <E> java.util.Set<E>
newLinkedHashSet(java.lang.Iterable<E> elements)
static <E> java.util.Set<E>
newLinkedHashSet(java.util.Collection<? extends E> elements)
static <E> java.util.Set<E>
newLinkedHashSet(java.util.Iterator<E> elements)
static <E> java.util.Set<E>
of(E... elements)
Convert to multiple elements to beLinkedHashSet
static <E> java.util.Set<E>
ofSet(E one, E... others)
Convert to one or more elements to be a read-onlySet
static <E> java.util.Set<E>
ofSet(java.lang.Iterable<E> elements)
Convert to multiple elements to beLinkedHashSet
static <T> java.util.Set<T>
ofSet(java.util.Collection<T> elements, T... others)
static <E> java.util.Set<E>
ofSet(java.util.Enumeration<E> elements)
Build a read-onlySet
from the given elements
-
-
-
Method Detail
-
isSet
public static boolean isSet(java.lang.Iterable<?> elements)
-
of
public static <E> java.util.Set<E> of(E... elements)
Convert to multiple elements to beLinkedHashSet
- Type Parameters:
E
- the type ofelements
- Parameters:
elements
- one or more elements- Returns:
- read-only
Set
-
ofSet
@Nonnull public static <E> java.util.Set<E> ofSet(java.util.Enumeration<E> elements)
Build a read-onlySet
from the given elements- Type Parameters:
E
- the type ofelements
- Parameters:
elements
- one or more elements- Returns:
- non-null read-only
Set
-
ofSet
public static <E> java.util.Set<E> ofSet(java.lang.Iterable<E> elements)
Convert to multiple elements to beLinkedHashSet
- Type Parameters:
E
- the type ofelements
- Parameters:
elements
- one or more elements- Returns:
- read-only
Set
-
ofSet
public static <E> java.util.Set<E> ofSet(E one, E... others)
Convert to one or more elements to be a read-onlySet
- Type Parameters:
E
- the type ofelements
- Parameters:
one
- one elementothers
- others elements- Returns:
- read-only
Set
-
ofSet
public static <T> java.util.Set<T> ofSet(java.util.Collection<T> elements, T... others)
-
newHashSet
public static <E> java.util.Set<E> newHashSet(java.lang.Iterable<E> elements)
-
newHashSet
public static <E> java.util.Set<E> newHashSet(java.util.Collection<? extends E> elements)
-
newHashSet
public static <E> java.util.Set<E> newHashSet()
-
newHashSet
public static <E> java.util.Set<E> newHashSet(int initialCapacity)
-
newHashSet
public static <E> java.util.Set<E> newHashSet(int initialCapacity, float loadFactor)
-
newLinkedHashSet
public static <E> java.util.Set<E> newLinkedHashSet(java.lang.Iterable<E> elements)
-
newLinkedHashSet
public static <E> java.util.Set<E> newLinkedHashSet(java.util.Iterator<E> elements)
-
newLinkedHashSet
public static <E> java.util.Set<E> newLinkedHashSet(java.util.Collection<? extends E> elements)
-
newLinkedHashSet
public static <E> java.util.Set<E> newLinkedHashSet()
-
newLinkedHashSet
public static <E> java.util.Set<E> newLinkedHashSet(int initialCapacity)
-
newLinkedHashSet
public static <E> java.util.Set<E> newLinkedHashSet(int initialCapacity, float loadFactor)
-
-