public class Collect extends Object
| Modifier | Constructor and Description |
|---|---|
private |
Collect() |
| Modifier and Type | Method and Description |
|---|---|
static <T> List<T> |
arrayListOf(Iterable<T> values) |
static <T> List<T> |
arrayListOf(T[] values) |
static <T> List<T> |
arrayListOf(T first,
T... additional) |
static <K,V> Map<K,V> |
fixedSizeMap(int maximumNumberOfEntries)
Create a fixed sized Map that removes the least-recently used entry when the map becomes too large.
|
static <K,V> Map<K,V> |
hashMapOf(K key,
V value) |
static <K,V> Map<K,V> |
hashMapOf(K key1,
V value1,
K key2,
V value2) |
static <K,V> Map<K,V> |
hashMapOf(K key1,
V value1,
K key2,
V value2,
K key3,
V value3) |
static <K,V> Map<K,V> |
hashMapOf(K key1,
V value1,
K key2,
V value2,
K key3,
V value3,
K key4,
V value4) |
static <K,V> Map<K,V> |
hashMapOf(K key1,
V value1,
K key2,
V value2,
K key3,
V value3,
K key4,
V value4,
K key5,
V value5) |
static <K,V> Map<K,V> |
hashMapOf(K key1,
V value1,
K key2,
V value2,
K key3,
V value3,
K key4,
V value4,
K key5,
V value5,
K key6,
V value6) |
static <K,V> Map<K,V> |
linkMapOf(K key,
V value) |
static <K,V> Map<K,V> |
linkMapOf(K key1,
V value1,
K key2,
V value2) |
static <K,V> Map<K,V> |
linkMapOf(K key1,
V value1,
K key2,
V value2,
K key3,
V value3) |
static <K,V> Map<K,V> |
linkMapOf(K key1,
V value1,
K key2,
V value2,
K key3,
V value3,
K key4,
V value4) |
static <K,V> Map<K,V> |
mapOf(K key,
V value) |
static <T> void |
set(List<T> list,
int index,
T value,
T defaultValue)
Set the value at the given position in the list, expanding the list as required to accommodate the new position.
|
static <T> Set<T> |
unmodifiableSet(Collection<T> values) |
static <T,V> Set<T> |
unmodifiableSet(Function<V,T> extractor,
Collection<V> values) |
static <T,V> Set<T> |
unmodifiableSet(Function<V,T> extractor,
V... values) |
static <T> Set<T> |
unmodifiableSet(Set<T> values) |
static <T> Set<T> |
unmodifiableSet(Set<T> values,
T... additionalValues) |
static <T> Set<T> |
unmodifiableSet(T... values) |
public static <K,V> Map<K,V> fixedSizeMap(int maximumNumberOfEntries)
maximumNumberOfEntries should be a power of 2 to efficiently make efficient use of memory. If not, the resulting
map will be able to contain no more than maximumNumberOfEntries entries, but the underlying map will have a
capacity that is the next power of larger than the supplied maximumNumberOfEntries value so that it can hold
the required number of entries.maximumNumberOfEntries - the maximum number of entries allowed in the map; should be a power of 2public static <T,V> Set<T> unmodifiableSet(Function<V,T> extractor, Collection<V> values)
public static <T> Set<T> unmodifiableSet(T... values)
public static <T> Set<T> unmodifiableSet(Collection<T> values)
public static <T> List<T> arrayListOf(T[] values)
public static <T> List<T> arrayListOf(T first, T... additional)
public static <K,V> Map<K,V> mapOf(K key, V value)
public static <K,V> Map<K,V> hashMapOf(K key, V value)
public static <K,V> Map<K,V> hashMapOf(K key1, V value1, K key2, V value2)
public static <K,V> Map<K,V> hashMapOf(K key1, V value1, K key2, V value2, K key3, V value3)
public static <K,V> Map<K,V> hashMapOf(K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4)
public static <K,V> Map<K,V> hashMapOf(K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4, K key5, V value5)
public static <K,V> Map<K,V> hashMapOf(K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4, K key5, V value5, K key6, V value6)
public static <K,V> Map<K,V> linkMapOf(K key, V value)
public static <K,V> Map<K,V> linkMapOf(K key1, V value1, K key2, V value2)
public static <K,V> Map<K,V> linkMapOf(K key1, V value1, K key2, V value2, K key3, V value3)
public static <K,V> Map<K,V> linkMapOf(K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4)
public static <T> void set(List<T> list, int index, T value, T defaultValue)
This is not a thread-safe operation
list - the list to be modifiedindex - the index position of the new valuevalue - the valuedefaultValue - the value used for intermediate positions when expanding the list; may be nullCopyright © 2016 JBoss by Red Hat. All rights reserved.