Package de.alpharogroup.collections.set
Class SetFactory
- java.lang.Object
-
- de.alpharogroup.collections.set.SetFactory
-
public final class SetFactory extends java.lang.ObjectThe factory classSetFactoryprovides factory methods for create newSetobjects
-
-
Constructor Summary
Constructors Constructor Description SetFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> java.util.Set<T>newHashSet(java.util.Collection<T> collection, T... elements)Factory method for create newHashSetand will be returned asSetstatic <T> java.util.Set<T>newHashSet(T... elements)Factory method for create newHashSetand will be returned asSetstatic <T> java.util.Set<T>newInsertionOrderSet(java.util.Collection<T> collection, T... elements)Factory method for create newInsertionOrderSetand will be returned asSetstatic <T> java.util.Set<T>newInsertionOrderSet(T... elements)Factory method for create newInsertionOrderSetand will be returned asSetstatic <T> java.util.Set<T>newLinkedHashSet(java.util.Collection<T> collection, T... elements)Factory method for create newLinkedHashSetand will be returned asSetstatic <T> java.util.Set<T>newLinkedHashSet(T... elements)Factory method for create newLinkedHashSetand will be returned asSetstatic <T> java.util.SortedSet<T>newTreeSet(@NonNull java.util.Comparator<T> comparator, T... elements)Factory method for create newTreeSetand will be returned asSet.static <T> java.util.SortedSet<T>newTreeSet(java.util.Collection<T> collection, java.util.Comparator<T> comparator, T... elements)Factory method for create newTreeSetand will be returned asSortedSetstatic <T> java.util.SortedSet<T>newTreeSet(java.util.Collection<T> collection, T... elements)Factory method for create newTreeSetand will be returned asSortedSet.static <T> java.util.SortedSet<T>newTreeSet(T... elements)Factory method for create newTreeSetand will be returned asSetstatic <T> java.util.function.Supplier<java.util.SortedSet<T>>newTreeSetSupplier(@NonNull java.util.Comparator<T> comparator)Factory method for create newSupplierfor aTreeSetwith aComparator
-
-
-
Method Detail
-
newHashSet
@SafeVarargs public static <T> java.util.Set<T> newHashSet(T... elements)
Factory method for create newHashSetand will be returned asSet- Type Parameters:
T- the generic type of the elements- Parameters:
elements- the elements to add in the newHashSet- Returns:
- the new
HashSet
-
newHashSet
@SafeVarargs public static <T> java.util.Set<T> newHashSet(java.util.Collection<T> collection, T... elements)Factory method for create newHashSetand will be returned asSet- Type Parameters:
T- the generic type of the elements- Parameters:
collection- the optional collection that will be added to the new listelements- the elements to add in the newHashSet- Returns:
- the new
HashSet
-
newLinkedHashSet
@SafeVarargs public static <T> java.util.Set<T> newLinkedHashSet(T... elements)
Factory method for create newLinkedHashSetand will be returned asSet- Type Parameters:
T- the generic type of the elements- Parameters:
elements- the elements to add in the newHashSet- Returns:
- the new
LinkedHashSet
-
newLinkedHashSet
@SafeVarargs public static <T> java.util.Set<T> newLinkedHashSet(java.util.Collection<T> collection, T... elements)Factory method for create newLinkedHashSetand will be returned asSet- Type Parameters:
T- the generic type of the elements- Parameters:
collection- the optional collection that will be added to the new listelements- the elements to add in the newLinkedHashSet- Returns:
- the new
HashSet
-
newInsertionOrderSet
@SafeVarargs public static <T> java.util.Set<T> newInsertionOrderSet(T... elements)
Factory method for create newInsertionOrderSetand will be returned asSet- Type Parameters:
T- the generic type of the elements- Parameters:
elements- the elements to add in the newInsertionOrderSet- Returns:
- the new
InsertionOrderSet
-
newInsertionOrderSet
@SafeVarargs public static <T> java.util.Set<T> newInsertionOrderSet(java.util.Collection<T> collection, T... elements)Factory method for create newInsertionOrderSetand will be returned asSet- Type Parameters:
T- the generic type of the elements- Parameters:
collection- the optional collection that will be added to the new listelements- the elements to add in the newInsertionOrderSet- Returns:
- the new
InsertionOrderSet
-
newTreeSet
@SafeVarargs public static <T> java.util.SortedSet<T> newTreeSet(T... elements)
Factory method for create newTreeSetand will be returned asSet- Type Parameters:
T- the generic type of the elements- Parameters:
elements- the elements to add in the newTreeSet- Returns:
- the new
SortedSet
-
newTreeSet
@SafeVarargs public static <T> java.util.SortedSet<T> newTreeSet(@NonNull @NonNull java.util.Comparator<T> comparator, T... elements)Factory method for create newTreeSetand will be returned asSet.- Type Parameters:
T- the generic type of the elements- Parameters:
comparator- the comparatorelements- the elements to add in the newTreeSet- Returns:
- the new
SortedSet
-
newTreeSet
@SafeVarargs public static <T> java.util.SortedSet<T> newTreeSet(java.util.Collection<T> collection, T... elements)Factory method for create newTreeSetand will be returned asSortedSet.- Type Parameters:
T- the generic type of the elements- Parameters:
collection- the optional collection that will be added to the new listelements- the elements to add in the newTreeSet- Returns:
- the new
SortedSet
-
newTreeSet
@SafeVarargs public static <T> java.util.SortedSet<T> newTreeSet(java.util.Collection<T> collection, java.util.Comparator<T> comparator, T... elements)Factory method for create newTreeSetand will be returned asSortedSet- Type Parameters:
T- the generic type of the elements- Parameters:
collection- the optional collection that will be added to the new listcomparator- the comparatorelements- the elements to add in the newTreeSet- Returns:
- the new
TreeSet
-
newTreeSetSupplier
public static <T> java.util.function.Supplier<java.util.SortedSet<T>> newTreeSetSupplier(@NonNull @NonNull java.util.Comparator<T> comparator)Factory method for create newSupplierfor aTreeSetwith aComparator- Type Parameters:
T- the generic type of the elements- Parameters:
comparator- the comparator- Returns:
- the new
Supplier
-
-