public class Sets
extends java.lang.Object
| Constructor and Description |
|---|
Sets() |
| Modifier and Type | Method and Description |
|---|---|
static <T extends java.util.Set<O>,O> |
any(java.util.function.Supplier<T> setSupplier,
java.util.function.Consumer<T> setConsumer)
Create a new set which is passed to the given consumer.
|
static <T extends java.util.Set<O>,O> |
any(java.util.function.Supplier<T> setSupplier,
O... objects)
Create a new set with the given objects.
|
static <T> java.util.concurrent.ConcurrentSkipListSet<T> |
concurrentSkipListSet(java.util.function.Consumer<java.util.concurrent.ConcurrentSkipListSet<T>> setConsumer)
Create a new
ConcurrentSkipListSet which is passed to the given consumer. |
static <T> java.util.concurrent.ConcurrentSkipListSet<T> |
concurrentSkipListSet(T... objects)
Create a new
ConcurrentSkipListSet with the given objects. |
static <T> java.util.HashSet<T> |
hashSet(java.util.function.Consumer<java.util.HashSet<T>> setConsumer)
Create a new
HashSet which is passed to the given consumer. |
static <T> java.util.HashSet<T> |
hashSet(T... objects)
Create a new
HashSet with the given objects. |
static <T> java.util.Set<T> |
identitySet(java.util.function.Consumer<java.util.Set<T>> setConsumer)
Create a new
IdentityHashMap based set which is passed to the given consumer. |
static <T> java.util.Set<T> |
identitySet(T... objects)
Create a new
IdentityHashMap based set with the given objects. |
static <T> java.util.LinkedHashSet<T> |
linkedHashSet(java.util.function.Consumer<java.util.LinkedHashSet<T>> setConsumer)
Create a new
LinkedHashSet which is passed to the given consumer. |
static <T> java.util.LinkedHashSet<T> |
linkedHashSet(T... objects)
Create a new
LinkedHashSet with the given objects. |
static <T> java.util.Set<T> |
merge(java.util.Set<T> set,
java.util.Set<T>... others)
Merge multiple sets into one.
|
static <T> java.util.LinkedHashSet<T> |
sort(java.util.Set<T> set,
java.util.Comparator<T> comparator)
Sort a set using the given comparator.
|
public static <T> java.util.LinkedHashSet<T> sort(java.util.Set<T> set,
java.util.Comparator<T> comparator)
LinkedHashSet to keep the order of the set.T - The type of the setset - The set to sortcomparator - The comparator to use@SafeVarargs
public static <T> java.util.Set<T> merge(java.util.Set<T> set,
java.util.Set<T>... others)
T - The set typeset - The first setothers - The other sets@SafeVarargs
public static <T extends java.util.Set<O>,O> T any(java.util.function.Supplier<T> setSupplier,
O... objects)
T - The set typeO - The object typesetSupplier - The supplier for the setobjects - The objects to add to the setpublic static <T extends java.util.Set<O>,O> T any(java.util.function.Supplier<T> setSupplier,
java.util.function.Consumer<T> setConsumer)
T - The set typeO - The object typesetSupplier - The supplier to create the setsetConsumer - The consumer to pass the set to@SafeVarargs public static <T> java.util.HashSet<T> hashSet(T... objects)
HashSet with the given objects.T - The object typeobjects - The objects to add to the setpublic static <T> java.util.HashSet<T> hashSet(java.util.function.Consumer<java.util.HashSet<T>> setConsumer)
HashSet which is passed to the given consumer.T - The object typesetConsumer - The consumer to pass the set to@SafeVarargs public static <T> java.util.LinkedHashSet<T> linkedHashSet(T... objects)
LinkedHashSet with the given objects.T - The object typeobjects - The objects to add to the setpublic static <T> java.util.LinkedHashSet<T> linkedHashSet(java.util.function.Consumer<java.util.LinkedHashSet<T>> setConsumer)
LinkedHashSet which is passed to the given consumer.T - The object typesetConsumer - The consumer to pass the set to@SafeVarargs public static <T> java.util.concurrent.ConcurrentSkipListSet<T> concurrentSkipListSet(T... objects)
ConcurrentSkipListSet with the given objects.T - The object typeobjects - The objects to add to the setpublic static <T> java.util.concurrent.ConcurrentSkipListSet<T> concurrentSkipListSet(java.util.function.Consumer<java.util.concurrent.ConcurrentSkipListSet<T>> setConsumer)
ConcurrentSkipListSet which is passed to the given consumer.T - The object typesetConsumer - The consumer to pass the set to@SafeVarargs public static <T> java.util.Set<T> identitySet(T... objects)
IdentityHashMap based set with the given objects.T - The object typeobjects - The objects to add to the setpublic static <T> java.util.Set<T> identitySet(java.util.function.Consumer<java.util.Set<T>> setConsumer)
IdentityHashMap based set which is passed to the given consumer.T - The object typesetConsumer - The consumer to pass the set to