public class CollectionTool extends Object
| Constructor and Description |
|---|
CollectionTool() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T[] |
arrayOf(T... items)
Create an array
|
static <K,V> Map.Entry<K,V> |
entryOf(K key,
V value)
Create a map entry
|
static <T> List<T> |
fastListOf(T... items)
Create an immutable list
|
static <T> List<T> |
listOf(T... items)
Create a mutable list
|
static <K,V> Map<K,V> |
mapOf(Map.Entry<K,V>... entry)
Create a mutable map
|
static <K,V> Map<K,V> |
orderedMapOf(Map.Entry<K,V>... entry)
Create an mutable ordered map
|
static <T> Set<T> |
setOf(T... items)
Create a mutable set
|
static <T> T[] |
slice(T[] args,
int startPos)
Get slice of args[startPos, args.length]
|
static <T> T[] |
slice(T[] args,
int startPos,
int endPos)
Get slice of args[startPos, endPos]
|
public static <T> T[] slice(T[] args,
int startPos)
args - original item arraystartPos - index of the first item to keeppublic static <T> T[] slice(T[] args,
int startPos,
int endPos)
args - original item arraystartPos - index of the first item to keependPos - index of the last item to keeppublic static <T> T[] arrayOf(T... items)
items - elements to addpublic static <T> List<T> fastListOf(T... items)
items - elements to addpublic static <T> List<T> listOf(T... items)
items - elements to addpublic static <T> Set<T> setOf(T... items)
items - elements to addpublic static <K,V> Map<K,V> mapOf(Map.Entry<K,V>... entry)
entry - elements to addpublic static <K,V> Map<K,V> orderedMapOf(Map.Entry<K,V>... entry)
entry - elements to addpublic static <K,V> Map.Entry<K,V> entryOf(K key, V value)
key - the keyvalue - the valueCopyright © 2022. All rights reserved.