Package org.javalite.common
Class Collections
java.lang.Object
org.javalite.common.Collections
- Author:
- Igor Polevoy, Eric Nielsen
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T[]
arr(T... values)
Create array from values.static <T> T[]
array(T... values)
Create array from values.static <T> List<T>
li(T... values)
Create a list from values.static <T> List<T>
list(T... values)
Create a list from values.static <K, V> Map<K,V>
Create a map from keys and values.static <T> Set<T>
set(T... values)
Creates a set from values.
-
Method Details
-
arr
public static <T> T[] arr(T... values)Create array from values.- Parameters:
values
- values to create array from.- Returns:
- array filled with values from arguments.
-
array
public static <T> T[] array(T... values)Create array from values.- Parameters:
values
- values to create array from.- Returns:
- array filled with values from arguments.
-
set
Creates a set from values.- Parameters:
values
- values for a set.- Returns:
- set filled with values.
-
map
Create a map from keys and values.- Parameters:
keysAndValues
- list of key value pairs. The number of items must be even. The argument at index 0 is a key of the value at index 1, argument at index 2 is key of value at index 3, and so on.- Returns:
- Map filled with keys and values.
-
li
Create a list from values.- Parameters:
values
- values to create a list from.- Returns:
- list with values.
-
list
Create a list from values.- Parameters:
values
- values to create a list from.- Returns:
- list with values.
-