public class CollectionUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T,C extends Collection<T>> |
addAll(C to,
Iterable<T> elements) |
static <T,C extends Collection<T>> |
addAll(C to,
Iterator<T> elements) |
static <T,C extends Collection<T>> |
addAll(C to,
T... elements) |
static <T> Collection<T> |
asCollection(Iterable<T> in) |
static <T> List<T> |
asImmutableList(Iterable<T> in) |
static <T> List<T> |
asImmutableList(T... objects)
|
static <K,V> Map<K,V> |
asImmutableMap(Map<K,V> map) |
static <K,V> Map<K,V> |
asImmutableMap(Object... a)
Returns a
LinkedHashMap
with the mappings a[0] => a[1], a[2] => a[3], .... |
static <T> Set<T> |
asImmutableSet(Iterable<T> in) |
static <T> List<T> |
asList(Enumeration<T> in) |
static <T> List<T> |
asList(Iterable<T> in) |
static <T> List<T> |
asList(Iterator<T> iterator) |
static <T> List<T> |
asList(T... objects)
|
static <K,V> Map<K,V> |
asMap(Object... a)
Returns a
LinkedHashMap
with the mappings a[0] => a[1], a[2] => a[3], .... |
static <T> Set<T> |
asSet(Iterable<T> in) |
static <T> long |
countElementsOf(Iterable<T> iterable) |
static <T> long |
countElementsOf(Iterator<T> iterator) |
static <T> CloseableIterator<T> |
emptyIterator() |
static <K,V> Map<K,V> |
putAll(Map<K,V> original,
Object... a)
Returns the given map enriched
with the mappings
a[0] => a[1], a[2] => a[3], .... |
static <K,V> Map<K,V> |
putAllAndMakeImmutable(Map<K,V> original,
Object... a)
Returns the given map enriched
with the mappings
a[0] => a[1], a[2] => a[3], .... |
@Nonnull public static <K,V> Map<K,V> putAll(@Nonnull Map<K,V> original, @Nullable Object... a)
a[0] => a[1], a[2] => a[3], ....@Nonnull public static <K,V> Map<K,V> asMap(@Nullable Object... a)
LinkedHashMap
with the mappings a[0] => a[1], a[2] => a[3], ....@Nonnull public static <K,V> Map<K,V> putAllAndMakeImmutable(@Nonnull Map<K,V> original, @Nullable Object... a)
a[0] => a[1], a[2] => a[3], ....@Nonnull public static <K,V> Map<K,V> asImmutableMap(@Nullable Object... a)
LinkedHashMap
with the mappings a[0] => a[1], a[2] => a[3], ....@SafeVarargs @Nonnull public static <T,C extends Collection<T>> C addAll(@Nonnull C to, @Nullable T... elements)
@Nonnull public static <T,C extends Collection<T>> C addAll(@Nonnull C to, @Nullable Iterable<T> elements)
@Nonnull public static <T,C extends Collection<T>> C addAll(@Nonnull C to, @Nullable Iterator<T> elements)
@Nonnull public static <T> Collection<T> asCollection(@Nullable Iterable<T> in)
@SafeVarargs @Nonnull public static <T> List<T> asList(@Nullable T... objects)
@SafeVarargs @Nonnull public static <T> List<T> asImmutableList(@Nullable T... objects)
@Nonnull public static <T> List<T> asList(@Nullable Enumeration<T> in)
@Nonnull public static <T> CloseableIterator<T> emptyIterator()
@Nonnegative public static <T> long countElementsOf(@Nullable Iterable<T> iterable)
@Nonnegative public static <T> long countElementsOf(@Nullable Iterator<T> iterator)
Copyright © 2024 echocat. All rights reserved.