public final class SetFactory
extends java.lang.Object
SetFactory provides factory methods for create new Set objects| Modifier and Type | Method and Description |
|---|---|
static <T> java.util.Set<T> |
newHashSet(java.util.Collection<T> collection,
T... elements)
Factory method for create new
HashSet and will be returned as Set |
static <T> java.util.Set<T> |
newHashSet(T... elements)
Factory method for create new
HashSet and will be returned as Set |
static <T> java.util.Set<T> |
newInsertionOrderSet(java.util.Collection<T> collection,
T... elements)
Factory method for create new
InsertionOrderSet and will be returned as Set |
static <T> java.util.Set<T> |
newInsertionOrderSet(T... elements)
Factory method for create new
InsertionOrderSet and will be returned as Set |
static <T> java.util.Set<T> |
newLinkedHashSet(java.util.Collection<T> collection,
T... elements)
Factory method for create new
LinkedHashSet and will be returned as Set |
static <T> java.util.Set<T> |
newLinkedHashSet(T... elements)
Factory method for create new
LinkedHashSet and will be returned as Set |
static <T> java.util.SortedSet<T> |
newTreeSet(java.util.Collection<T> collection,
java.util.Comparator<T> comparator,
T... elements)
Factory method for create new
TreeSet and will be returned as SortedSet |
static <T> java.util.SortedSet<T> |
newTreeSet(java.util.Collection<T> collection,
T... elements)
Factory method for create new
TreeSet and will be returned as SortedSet. |
static <T> java.util.SortedSet<T> |
newTreeSet(java.util.Comparator<T> comparator,
T... elements)
Factory method for create new
TreeSet and will be returned as Set. |
static <T> java.util.SortedSet<T> |
newTreeSet(T... elements)
Factory method for create new
TreeSet and will be returned as Set |
static <T> java.util.function.Supplier<java.util.SortedSet<T>> |
newTreeSetSupplier(java.util.Comparator<T> comparator)
Factory method for create new
Supplier for a TreeSet with a
Comparator |
@SafeVarargs
public static <T> java.util.Set<T> newHashSet(java.util.Collection<T> collection,
T... elements)
HashSet and will be returned as SetT - the generic type of the elementscollection - the optional collection that will be added to the new listelements - the elements to add in the new HashSetHashSet@SafeVarargs public static <T> java.util.Set<T> newHashSet(T... elements)
HashSet and will be returned as SetT - the generic type of the elementselements - the elements to add in the new HashSetHashSet@SafeVarargs
public static <T> java.util.Set<T> newInsertionOrderSet(java.util.Collection<T> collection,
T... elements)
InsertionOrderSet and will be returned as SetT - the generic type of the elementscollection - the optional collection that will be added to the new listelements - the elements to add in the new InsertionOrderSetInsertionOrderSet@SafeVarargs public static <T> java.util.Set<T> newInsertionOrderSet(T... elements)
InsertionOrderSet and will be returned as SetT - the generic type of the elementselements - the elements to add in the new InsertionOrderSetInsertionOrderSet@SafeVarargs
public static <T> java.util.Set<T> newLinkedHashSet(java.util.Collection<T> collection,
T... elements)
LinkedHashSet and will be returned as SetT - the generic type of the elementscollection - the optional collection that will be added to the new listelements - the elements to add in the new LinkedHashSetHashSet@SafeVarargs public static <T> java.util.Set<T> newLinkedHashSet(T... elements)
LinkedHashSet and will be returned as SetT - the generic type of the elementselements - the elements to add in the new HashSetLinkedHashSet@SafeVarargs
public static <T> java.util.SortedSet<T> newTreeSet(java.util.Collection<T> collection,
java.util.Comparator<T> comparator,
T... elements)
TreeSet and will be returned as SortedSetT - the generic type of the elementscollection - the optional collection that will be added to the new listcomparator - the comparatorelements - the elements to add in the new TreeSetTreeSet@SafeVarargs
public static <T> java.util.SortedSet<T> newTreeSet(java.util.Collection<T> collection,
T... elements)
TreeSet and will be returned as SortedSet.T - the generic type of the elementscollection - the optional collection that will be added to the new listelements - the elements to add in the new TreeSetSortedSet@SafeVarargs
public static <T> java.util.SortedSet<T> newTreeSet(java.util.Comparator<T> comparator,
T... elements)
TreeSet and will be returned as Set.T - the generic type of the elementscomparator - the comparatorelements - the elements to add in the new TreeSetSortedSet@SafeVarargs public static <T> java.util.SortedSet<T> newTreeSet(T... elements)
TreeSet and will be returned as SetT - the generic type of the elementselements - the elements to add in the new TreeSetSortedSetpublic static <T> java.util.function.Supplier<java.util.SortedSet<T>> newTreeSetSupplier(java.util.Comparator<T> comparator)
Supplier for a TreeSet with a
ComparatorT - the generic type of the elementscomparator - the comparatorSupplier