public class ListHelper<T> extends Object
| Constructor and Description |
|---|
ListHelper(List<T> list) |
| Modifier and Type | Method and Description |
|---|---|
T |
at(int index) |
void |
compact$()
Remove null values in list
|
int |
count() |
int |
count($.Condition<T> condition) |
List<T> |
drop(int n) |
void |
each($.Each<T> each) |
T |
fetch(int index)
Identical of
List.get(int) |
T |
fetch(int index,
T def)
Null-safe, defining the default value
|
T |
first() |
void |
insert(T... ts) |
ListHelper<T> |
insert(T t) |
boolean |
isEmpty() |
boolean |
isNotEmpty() |
T |
last() |
int |
length() |
List<T> |
map($.Map<T> map) |
void |
map$($.Map<T> map) |
List<T> |
reject($.Condition<T> condition) |
void |
reject$($.Condition<T> condition) |
List<T> |
select($.Condition<T> condition) |
void |
select$($.Condition<T> condition) |
int |
size() |
List<T> |
take(int n)
Get the first n elements of list
|
<R> List<R> |
transform($.Transform<T,R> transform) |
public List<T> select($.Condition<T> condition)
public List<T> reject($.Condition<T> condition)
public <R> List<R> transform($.Transform<T,R> transform)
public void select$($.Condition<T> condition)
public void reject$($.Condition<T> condition)
public void compact$()
public T at(int index)
public T fetch(int index)
List.get(int)index - index of elementIndexOutOfBoundsExceptionpublic T fetch(int index, T def)
index - index of elementdef - Default valuepublic T first()
public T last()
public List<T> take(int n)
n - number of elementspublic boolean isEmpty()
public int size()
public boolean isNotEmpty()
public int count()
public int count($.Condition<T> condition)
public int length()
public void insert(T... ts)
public ListHelper<T> insert(T t)
Copyright © 2014. All Rights Reserved.