public class Lists extends Object
Constructor and Description |
---|
Lists() |
Modifier and Type | Method and Description |
---|---|
static <V> void |
add(List<V> list,
V... values) |
static <V> void |
add(List<V> list,
V value) |
static <T> T |
atIndex(List<T> list,
int index) |
static <V> void |
atIndex(List<V> list,
int index,
V v) |
static <V,WRAP> List<WRAP> |
convert(Class<WRAP> wrapper,
Collection<V> collection) |
static <V,WRAP> List<WRAP> |
convert(Class<WRAP> wrapper,
Iterable<V> collection) |
static <V,WRAP> List<WRAP> |
convert(Class<WRAP> wrapper,
V[] collection) |
static <V> List<V> |
copy(ArrayList<V> list) |
static <V> List<V> |
copy(Collection<V> collection) |
static <V> List<V> |
copy(CopyOnWriteArrayList<V> list) |
static <V> List<V> |
copy(LinkedList<V> list) |
static <V> List<V> |
copy(List<V> list) |
static <V> List<V> |
deepCopy(Collection<V> collection) |
static <V,T> List<T> |
deepCopy(Collection<V> src,
Class<T> dest) |
static <V> List<V> |
deepCopy(List<V> list)
Clones each list item into a new instance with copied fields.
|
static <V> List<V> |
deepCopyToList(Collection<V> src,
List<V> dst) |
static <V> List<V> |
endSliceOf(List<V> list,
int endIndex) |
static <V> Enumeration<V> |
enumeration(List<V> list) |
static <T> List<T> |
filterBy(Collection<T> array,
Object object) |
static <T> List<T> |
filterBy(Collection<T> array,
Object object,
String methodName) |
static <T> List<T> |
filterBy(Collection<T> array,
Predicate<T> predicate) |
static <T> List<T> |
filterBy(Iterable<T> array,
Object object) |
static <T> List<T> |
filterBy(Iterable<T> array,
Object object,
String methodName) |
static <T> List<T> |
filterBy(Iterable<T> array,
Predicate<T> predicate) |
static <T> List<T> |
filterBy(Predicate<T> predicate,
T[] array) |
static <T> List<T> |
filterBy(T[] array,
Object object) |
static <T> List<T> |
filterBy(T[] array,
Object object,
String methodName) |
static <T> T |
fromList(List<Object> list,
Class<T> clazz) |
static <T> T |
idx(List<T> list,
int index) |
static <V> void |
idx(List<V> list,
int index,
V v) |
static <T> List |
idxList(List<T> list,
int index) |
static <T> Map |
idxMap(List<T> list,
int index) |
static <V> boolean |
in(V value,
List<?> list) |
static <V> void |
insert(List<V> list,
int index,
V v) |
static boolean |
isEmpty(List<?> list) |
static <T> List<T> |
lazyAdd(ArrayList<T> list,
T... items) |
static <T> List<T> |
lazyAdd(CopyOnWriteArrayList<T> list,
T... items) |
static <T> List<T> |
lazyAdd(List<T> list,
T... items) |
static <T> List<T> |
lazyCreate(ArrayList<T> list) |
static <T> List<T> |
lazyCreate(CopyOnWriteArrayList<T> list) |
static <T> List<T> |
lazyCreate(List<T> list) |
static int |
len(List<?> list)
Universal methods
|
static int |
lengthOf(List<?> list) |
static <V> List<V> |
linkedList(Collection<V> collection) |
static <V> List<V> |
linkedList(V... array) |
static <V> List<V> |
list(Class<V> clazz) |
static <V> List<V> |
list(Enumeration<V> enumeration) |
static <V> List<V> |
list(Iterable<V> iterable) |
static <V> List<V> |
list(Iterator<V> iterator) |
static <V> List<V> |
list(V... array) |
static <T> List<T> |
listFromProperty(Class<T> propertyType,
String propertyPath,
Collection<?> list) |
static <T> List<T> |
listFromProperty(Class<T> propertyType,
String propertyPath,
Iterable<?> list) |
static <V> List<List<V>> |
lists(Collection<V>... collections) |
static <T> List<T> |
mapBy(Class<T> cls,
Collection<?> objects,
Object function) |
static List<?> |
mapBy(Collection<?> objects,
Class<?> cls,
String methodName) |
static List<?> |
mapBy(Collection<?> objects,
Object function) |
static List<?> |
mapBy(Collection<?> objects,
Object object,
String methodName) |
static <V,N> List<N> |
mapBy(Collection<V> array,
Function<V,N> function) |
static List<?> |
mapBy(Iterable<?> objects,
Class<?> cls,
String methodName) |
static List<?> |
mapBy(Iterable<?> objects,
Object function) |
static List<?> |
mapBy(Iterable<?> objects,
Object instance,
String methodName) |
static <V,N> List<N> |
mapBy(Iterable<V> array,
Function<V,N> function) |
static List<?> |
mapBy(Object[] objects,
Class<?> cls,
String methodName) |
static List<?> |
mapBy(Object[] objects,
Object function) |
static List<?> |
mapBy(Object[] objects,
Object instance,
String methodName) |
static <V,N> List<N> |
mapBy(V[] array,
Function<V,N> function) |
static Object |
reduceBy(Iterable<?> array,
Object object) |
static <V,SUM> SUM |
reduceBy(Iterable<V> array,
Reducer<V,SUM> function) |
static <T> List<T> |
safeLazyAdd(CopyOnWriteArrayList<T> list,
T... items) |
static <T> List<T> |
safeLazyCreate(CopyOnWriteArrayList<T> list) |
static <V> List<V> |
safeList(Collection<V> collection) |
static <V> List<V> |
safeList(V... array) |
static void |
setListProperty(List<?> list,
String propertyName,
Object value) |
static <V> List<V> |
slc(List<V> list,
int startIndex) |
static <V> List<V> |
slc(List<V> list,
int startIndex,
int endIndex) |
static <V> List<V> |
slcEnd(List<V> list,
int endIndex) |
static <V> List<V> |
sliceOf(List<V> list,
int startIndex) |
static <V> List<V> |
sliceOf(List<V> list,
int startIndex,
int endIndex) |
static DoubleList |
toDoubleList(List<?> inputList,
String propertyPath) |
static FloatList |
toFloatList(List<?> inputList,
String propertyPath) |
static IntList |
toIntList(List<?> inputList,
String propertyPath) |
static <PROP> List<PROP> |
toList(List<?> inputList,
Class<PROP> cls,
String propertyPath) |
static List<?> |
toList(List<?> inputList,
String propertyPath) |
static List<?> |
toList(Object item) |
static List<Map<String,Object>> |
toListOfMaps(List<?> list) |
static List<?> |
toListOrSingletonList(Object item) |
static LongList |
toLongList(List<?> inputList,
String propertyPath) |
static <V,WRAP> List<WRAP> |
wrap(Class<WRAP> wrapper,
Collection<V> collection) |
static <V,WRAP> List<WRAP> |
wrap(Class<WRAP> wrapper,
Iterable<V> collection) |
static <V,WRAP> List<WRAP> |
wrap(Class<WRAP> wrapper,
V[] collection) |
public static <T> List<T> safeLazyAdd(CopyOnWriteArrayList<T> list, T... items)
public static <T> List<T> lazyAdd(CopyOnWriteArrayList<T> list, T... items)
public static <T> List<T> lazyCreate(CopyOnWriteArrayList<T> list)
public static <T> List<T> safeLazyCreate(CopyOnWriteArrayList<T> list)
public static <V> List<V> copy(Collection<V> collection)
public static <V> List<V> deepCopy(Collection<V> collection)
public static <V> List<V> deepCopyToList(Collection<V> src, List<V> dst)
public static <V,T> List<T> deepCopy(Collection<V> src, Class<T> dest)
public static <V> List<V> deepCopy(List<V> list)
V
- genericslist
- list to clonepublic static <V> List<List<V>> lists(Collection<V>... collections)
public static <PROP> List<PROP> toList(List<?> inputList, Class<PROP> cls, String propertyPath)
public static DoubleList toDoubleList(List<?> inputList, String propertyPath)
public static <V,WRAP> List<WRAP> convert(Class<WRAP> wrapper, Collection<V> collection)
public static <V,WRAP> List<WRAP> wrap(Class<WRAP> wrapper, Collection<V> collection)
public static <V> List<V> list(Enumeration<V> enumeration)
public static <V> Enumeration<V> enumeration(List<V> list)
@SafeVarargs public static <V> List<V> list(V... array)
@SafeVarargs public static <V> List<V> safeList(V... array)
@SafeVarargs public static <V> List<V> linkedList(V... array)
public static <V> List<V> safeList(Collection<V> collection)
public static <V> List<V> linkedList(Collection<V> collection)
public static int len(List<?> list)
public static int lengthOf(List<?> list)
public static boolean isEmpty(List<?> list)
public static <V> boolean in(V value, List<?> list)
public static <V> void add(List<V> list, V value)
public static <V> void add(List<V> list, V... values)
public static <T> T atIndex(List<T> list, int index)
public static <T> T idx(List<T> list, int index)
public static <V> void atIndex(List<V> list, int index, V v)
public static <V> void idx(List<V> list, int index, V v)
public static <V> List<V> copy(CopyOnWriteArrayList<V> list)
public static <V> List<V> copy(LinkedList<V> list)
public static <V> void insert(List<V> list, int index, V v)
public static <T> List<T> listFromProperty(Class<T> propertyType, String propertyPath, Collection<?> list)
public static <T> List<T> listFromProperty(Class<T> propertyType, String propertyPath, Iterable<?> list)
public static List<?> mapBy(Collection<?> objects, Class<?> cls, String methodName)
public static List<?> mapBy(Collection<?> objects, Object function)
public static <T> List<T> mapBy(Class<T> cls, Collection<?> objects, Object function)
public static List<?> mapBy(Collection<?> objects, Object object, String methodName)
public static <V,N> List<N> mapBy(Collection<V> array, Function<V,N> function)
public static <T> List<T> filterBy(Collection<T> array, Predicate<T> predicate)
public static <T> List<T> filterBy(Collection<T> array, Object object)
public static <T> List<T> filterBy(Collection<T> array, Object object, String methodName)
Copyright © 2014. All rights reserved.