Package com.util.lodash
Class Underscore.Chain<T>
- java.lang.Object
-
- com.util.lodash.Underscore.Chain<T>
-
- Direct Known Subclasses:
U.Chain
- Enclosing class:
- Underscore<T>
public static class Underscore.Chain<T> extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Underscore.Chain<java.util.List<T>>
chunk(int size)
Underscore.Chain<java.util.List<T>>
chunk(int size, int step)
Underscore.Chain<java.util.List<T>>
chunkFill(int size, int step, T fillValue)
Underscore.Chain<java.util.List<T>>
chunkFill(int size, T fillValue)
Underscore.Chain<T>
compact()
Underscore.Chain<T>
compact(T falsyValue)
Underscore.Chain<T>
concat(java.util.List<T>... lists)
Underscore.Chain<java.lang.Boolean>
contains(T elem)
Underscore.Chain<java.lang.Boolean>
containsWith(T elem)
Underscore.Chain<java.lang.Integer>
count(java.util.function.Predicate<T> pred)
Underscore.Chain<java.util.Map<T,java.lang.Integer>>
countBy()
<F> Underscore.Chain<java.util.Map<F,java.lang.Integer>>
countBy(java.util.function.Function<T,F> func)
Underscore.Chain<T>
cycle(int times)
Underscore.Chain<T>
difference(java.util.List<T>... lists)
Underscore.Chain<T>
distinct()
<F> Underscore.Chain<F>
distinctBy(java.util.function.Function<T,F> func)
Underscore.Chain<java.lang.Boolean>
every(java.util.function.Predicate<T> pred)
Underscore.Chain<T>
filter(java.util.function.Predicate<T> pred)
Underscore.Chain<T>
filterFalse(java.util.function.Predicate<T> pred)
Underscore.Chain<T>
filterIndexed(PredicateIndexed<T> pred)
Underscore.Chain<Optional<T>>
find(java.util.function.Predicate<T> pred)
Underscore.Chain<Optional<T>>
findLast(java.util.function.Predicate<T> pred)
<E> Underscore.Chain<Optional<T>>
findWhere(java.util.List<Tuple<java.lang.String,E>> properties)
Underscore.Chain<T>
first()
Underscore.Chain<T>
first(int n)
Underscore.Chain<T>
first(java.util.function.Predicate<T> pred)
Underscore.Chain<T>
first(java.util.function.Predicate<T> pred, int n)
Underscore.Chain<T>
firstOrNull()
Underscore.Chain<T>
firstOrNull(java.util.function.Predicate<T> pred)
Underscore.Chain
flatten()
Underscore.Chain<T>
forEach(java.util.function.Consumer<T> func)
Underscore.Chain<T>
forEachRight(java.util.function.Consumer<T> func)
<F> Underscore.Chain<java.util.Map<F,java.util.List<T>>>
groupBy(java.util.function.Function<T,F> func)
<F> Underscore.Chain<java.util.Map<F,Optional<T>>>
groupBy(java.util.function.Function<T,F> func, java.util.function.BinaryOperator<T> binaryOperator)
Underscore.Chain<java.util.Map<java.lang.Object,java.util.List<T>>>
indexBy(java.lang.String property)
Underscore.Chain<T>
initial()
Underscore.Chain<T>
initial(int n)
Underscore.Chain<T>
interpose(T element)
Underscore.Chain<T>
interposeByList(java.lang.Iterable<T> interIter)
Underscore.Chain<T>
intersection(java.util.List<T>... lists)
Underscore.Chain<T>
invoke(java.lang.String methodName)
Underscore.Chain<T>
invoke(java.lang.String methodName, java.util.List<java.lang.Object> args)
boolean
isEmpty()
boolean
isNotEmpty()
T
item()
Underscore.Chain<java.lang.String>
join()
Underscore.Chain<java.lang.String>
join(java.lang.String separator)
Underscore.Chain<T>
last()
Underscore.Chain<T>
last(int n)
Underscore.Chain<T>
lastOrNull()
Underscore.Chain<T>
lastOrNull(java.util.function.Predicate<T> pred)
Underscore.Chain<T>
limit(int size)
java.util.Map<java.lang.String,java.lang.Object>
map()
<F> Underscore.Chain<F>
map(java.util.function.Function<? super T,F> func)
<F> Underscore.Chain<F>
mapIndexed(java.util.function.BiFunction<java.lang.Integer,? super T,F> func)
<F> Underscore.Chain<F>
mapMulti(java.util.function.BiConsumer<? super T,? super java.util.function.Consumer<F>> mapper)
Underscore.Chain<java.lang.Comparable>
max()
<F extends java.lang.Comparable<? super F>>
Underscore.Chain<T>max(java.util.function.Function<T,F> func)
Underscore.Chain<java.lang.Comparable>
min()
<F extends java.lang.Comparable<? super F>>
Underscore.Chain<T>min(java.util.function.Function<T,F> func)
Underscore.Chain<java.lang.Object>
pluck(java.lang.String propertyName)
Underscore.Chain<Tuple<T,java.util.List<T>>>
pop()
Underscore.Chain<T>
push(T... values)
Underscore.Chain<java.lang.Integer>
range(int stop)
Underscore.Chain<java.lang.Integer>
range(int start, int stop)
Underscore.Chain<java.lang.Integer>
range(int start, int stop, int step)
<F> Underscore.Chain<F>
reduce(java.util.function.BiFunction<F,T,F> func, F zeroElem)
Underscore.Chain<Optional<T>>
reduce(java.util.function.BinaryOperator<T> func)
<F> Underscore.Chain<F>
reduceRight(java.util.function.BiFunction<F,T,F> func, F zeroElem)
Underscore.Chain<Optional<T>>
reduceRight(java.util.function.BinaryOperator<T> func)
Underscore.Chain<T>
reject(java.util.function.Predicate<T> pred)
Underscore.Chain<T>
rejectIndexed(PredicateIndexed<T> pred)
Underscore.Chain<T>
replace(java.util.function.Predicate<T> pred, T value)
Underscore.Chain<T>
replaceIndexed(PredicateIndexed<T> pred, T value)
Underscore.Chain<T>
rest()
Underscore.Chain<T>
rest(int n)
Underscore.Chain<T>
reverse()
Underscore.Chain<T>
sample()
Underscore.Chain<T>
sample(int howMany)
Underscore.Chain<Tuple<T,java.util.List<T>>>
shift()
Underscore.Chain<T>
shuffle()
int
size()
Underscore.Chain<T>
skip(int numberToSkip)
Underscore.Chain<T>
slice(int start)
Underscore.Chain<T>
slice(int start, int end)
Underscore.Chain<java.lang.Boolean>
some(java.util.function.Predicate<T> pred)
Underscore.Chain<java.lang.Comparable>
sort()
<F extends java.lang.Comparable<? super F>>
Underscore.Chain<T>sortBy(java.util.function.Function<T,F> func)
<K> Underscore.Chain<java.util.Map<K,java.lang.Comparable>>
sortBy(K key)
<F extends java.lang.Comparable<? super F>>
Underscore.Chain<F>sortWith(java.util.Comparator<F> comparator)
Underscore.Chain<java.util.List<T>>
splitAt(int position)
Underscore.Chain<T>
takeSkipping(int stepSize)
Underscore.Chain<T>
tap(java.util.function.Consumer<T> func)
java.util.List<T>
toList()
<K,V>
Underscore.Chain<java.util.Map<K,V>>toMap()
java.lang.String
toString()
Underscore.Chain<T>
union(java.util.List<T>... lists)
Underscore.Chain<T>
uniq()
<F> Underscore.Chain<T>
uniq(java.util.function.Function<T,F> func)
Underscore.Chain<T>
unshift(T... values)
java.util.List<T>
value()
<E> Underscore.Chain<T>
where(java.util.List<Tuple<java.lang.String,E>> properties)
-
-
-
Method Detail
-
first
public Underscore.Chain<T> first()
-
first
public Underscore.Chain<T> first(int n)
-
first
public Underscore.Chain<T> first(java.util.function.Predicate<T> pred)
-
first
public Underscore.Chain<T> first(java.util.function.Predicate<T> pred, int n)
-
firstOrNull
public Underscore.Chain<T> firstOrNull()
-
firstOrNull
public Underscore.Chain<T> firstOrNull(java.util.function.Predicate<T> pred)
-
initial
public Underscore.Chain<T> initial()
-
initial
public Underscore.Chain<T> initial(int n)
-
last
public Underscore.Chain<T> last()
-
last
public Underscore.Chain<T> last(int n)
-
lastOrNull
public Underscore.Chain<T> lastOrNull()
-
lastOrNull
public Underscore.Chain<T> lastOrNull(java.util.function.Predicate<T> pred)
-
rest
public Underscore.Chain<T> rest()
-
rest
public Underscore.Chain<T> rest(int n)
-
compact
public Underscore.Chain<T> compact()
-
compact
public Underscore.Chain<T> compact(T falsyValue)
-
flatten
public Underscore.Chain flatten()
-
map
public <F> Underscore.Chain<F> map(java.util.function.Function<? super T,F> func)
-
mapMulti
public <F> Underscore.Chain<F> mapMulti(java.util.function.BiConsumer<? super T,? super java.util.function.Consumer<F>> mapper)
-
mapIndexed
public <F> Underscore.Chain<F> mapIndexed(java.util.function.BiFunction<java.lang.Integer,? super T,F> func)
-
replace
public Underscore.Chain<T> replace(java.util.function.Predicate<T> pred, T value)
-
replaceIndexed
public Underscore.Chain<T> replaceIndexed(PredicateIndexed<T> pred, T value)
-
filter
public Underscore.Chain<T> filter(java.util.function.Predicate<T> pred)
-
filterIndexed
public Underscore.Chain<T> filterIndexed(PredicateIndexed<T> pred)
-
reject
public Underscore.Chain<T> reject(java.util.function.Predicate<T> pred)
-
rejectIndexed
public Underscore.Chain<T> rejectIndexed(PredicateIndexed<T> pred)
-
filterFalse
public Underscore.Chain<T> filterFalse(java.util.function.Predicate<T> pred)
-
reduce
public <F> Underscore.Chain<F> reduce(java.util.function.BiFunction<F,T,F> func, F zeroElem)
-
reduce
public Underscore.Chain<Optional<T>> reduce(java.util.function.BinaryOperator<T> func)
-
reduceRight
public <F> Underscore.Chain<F> reduceRight(java.util.function.BiFunction<F,T,F> func, F zeroElem)
-
reduceRight
public Underscore.Chain<Optional<T>> reduceRight(java.util.function.BinaryOperator<T> func)
-
find
public Underscore.Chain<Optional<T>> find(java.util.function.Predicate<T> pred)
-
findLast
public Underscore.Chain<Optional<T>> findLast(java.util.function.Predicate<T> pred)
-
max
public Underscore.Chain<java.lang.Comparable> max()
-
max
public <F extends java.lang.Comparable<? super F>> Underscore.Chain<T> max(java.util.function.Function<T,F> func)
-
min
public Underscore.Chain<java.lang.Comparable> min()
-
min
public <F extends java.lang.Comparable<? super F>> Underscore.Chain<T> min(java.util.function.Function<T,F> func)
-
sort
public Underscore.Chain<java.lang.Comparable> sort()
-
sortWith
public <F extends java.lang.Comparable<? super F>> Underscore.Chain<F> sortWith(java.util.Comparator<F> comparator)
-
sortBy
public <F extends java.lang.Comparable<? super F>> Underscore.Chain<T> sortBy(java.util.function.Function<T,F> func)
-
sortBy
public <K> Underscore.Chain<java.util.Map<K,java.lang.Comparable>> sortBy(K key)
-
groupBy
public <F> Underscore.Chain<java.util.Map<F,java.util.List<T>>> groupBy(java.util.function.Function<T,F> func)
-
groupBy
public <F> Underscore.Chain<java.util.Map<F,Optional<T>>> groupBy(java.util.function.Function<T,F> func, java.util.function.BinaryOperator<T> binaryOperator)
-
indexBy
public Underscore.Chain<java.util.Map<java.lang.Object,java.util.List<T>>> indexBy(java.lang.String property)
-
countBy
public <F> Underscore.Chain<java.util.Map<F,java.lang.Integer>> countBy(java.util.function.Function<T,F> func)
-
countBy
public Underscore.Chain<java.util.Map<T,java.lang.Integer>> countBy()
-
shuffle
public Underscore.Chain<T> shuffle()
-
sample
public Underscore.Chain<T> sample()
-
sample
public Underscore.Chain<T> sample(int howMany)
-
tap
public Underscore.Chain<T> tap(java.util.function.Consumer<T> func)
-
forEach
public Underscore.Chain<T> forEach(java.util.function.Consumer<T> func)
-
forEachRight
public Underscore.Chain<T> forEachRight(java.util.function.Consumer<T> func)
-
every
public Underscore.Chain<java.lang.Boolean> every(java.util.function.Predicate<T> pred)
-
some
public Underscore.Chain<java.lang.Boolean> some(java.util.function.Predicate<T> pred)
-
count
public Underscore.Chain<java.lang.Integer> count(java.util.function.Predicate<T> pred)
-
contains
public Underscore.Chain<java.lang.Boolean> contains(T elem)
-
containsWith
public Underscore.Chain<java.lang.Boolean> containsWith(T elem)
-
invoke
public Underscore.Chain<T> invoke(java.lang.String methodName, java.util.List<java.lang.Object> args)
-
invoke
public Underscore.Chain<T> invoke(java.lang.String methodName)
-
pluck
public Underscore.Chain<java.lang.Object> pluck(java.lang.String propertyName)
-
where
public <E> Underscore.Chain<T> where(java.util.List<Tuple<java.lang.String,E>> properties)
-
findWhere
public <E> Underscore.Chain<Optional<T>> findWhere(java.util.List<Tuple<java.lang.String,E>> properties)
-
uniq
public Underscore.Chain<T> uniq()
-
uniq
public <F> Underscore.Chain<T> uniq(java.util.function.Function<T,F> func)
-
distinct
public Underscore.Chain<T> distinct()
-
distinctBy
public <F> Underscore.Chain<F> distinctBy(java.util.function.Function<T,F> func)
-
union
public Underscore.Chain<T> union(java.util.List<T>... lists)
-
intersection
public Underscore.Chain<T> intersection(java.util.List<T>... lists)
-
difference
public Underscore.Chain<T> difference(java.util.List<T>... lists)
-
range
public Underscore.Chain<java.lang.Integer> range(int stop)
-
range
public Underscore.Chain<java.lang.Integer> range(int start, int stop)
-
range
public Underscore.Chain<java.lang.Integer> range(int start, int stop, int step)
-
chunk
public Underscore.Chain<java.util.List<T>> chunk(int size)
-
chunk
public Underscore.Chain<java.util.List<T>> chunk(int size, int step)
-
chunkFill
public Underscore.Chain<java.util.List<T>> chunkFill(int size, T fillValue)
-
chunkFill
public Underscore.Chain<java.util.List<T>> chunkFill(int size, int step, T fillValue)
-
cycle
public Underscore.Chain<T> cycle(int times)
-
interpose
public Underscore.Chain<T> interpose(T element)
-
interposeByList
public Underscore.Chain<T> interposeByList(java.lang.Iterable<T> interIter)
-
concat
public Underscore.Chain<T> concat(java.util.List<T>... lists)
-
slice
public Underscore.Chain<T> slice(int start)
-
slice
public Underscore.Chain<T> slice(int start, int end)
-
splitAt
public Underscore.Chain<java.util.List<T>> splitAt(int position)
-
takeSkipping
public Underscore.Chain<T> takeSkipping(int stepSize)
-
reverse
public Underscore.Chain<T> reverse()
-
join
public Underscore.Chain<java.lang.String> join()
-
join
public Underscore.Chain<java.lang.String> join(java.lang.String separator)
-
push
public Underscore.Chain<T> push(T... values)
-
pop
public Underscore.Chain<Tuple<T,java.util.List<T>>> pop()
-
shift
public Underscore.Chain<Tuple<T,java.util.List<T>>> shift()
-
unshift
public Underscore.Chain<T> unshift(T... values)
-
skip
public Underscore.Chain<T> skip(int numberToSkip)
-
limit
public Underscore.Chain<T> limit(int size)
-
toMap
public <K,V> Underscore.Chain<java.util.Map<K,V>> toMap()
-
isEmpty
public boolean isEmpty()
-
isNotEmpty
public boolean isNotEmpty()
-
size
public int size()
-
item
public T item()
-
value
public java.util.List<T> value()
-
map
public java.util.Map<java.lang.String,java.lang.Object> map()
-
toList
public java.util.List<T> toList()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-