Package com.github.underscore
Class Underscore
-
- All Implemented Interfaces:
public class Underscore<T>Underscore-java is a java port of Underscore.js.
Valentyn Kolesnikov
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classUnderscore.Chainpublic interfaceUnderscore.Function3public abstract classUnderscore.MemoizeFunctionpublic interfaceUnderscore.PredicateIndexedpublic interfaceUnderscore.Template
-
Constructor Summary
Constructors Constructor Description Underscore(Iterable<T> iterable)Underscore(String string)
-
Method Summary
Modifier and Type Method Description Iterable<T>getIterable()Optional<String>getString()static voidtemplateSettings(Map<String, String> templateSettings)static <K, V> Function<Map<K, V>, V>iteratee(K key)static <T> voideach(Iterable<T> iterable, Consumer<in T> func)static <T> voideachIndexed(Iterable<T> iterable, BiConsumer<Integer, in T> func)voideach(Consumer<in T> func)static <T> voideachRight(Iterable<T> iterable, Consumer<in T> func)voideachRight(Consumer<in T> func)static <T> voidforEach(Iterable<T> iterable, Consumer<in T> func)static <T> voidforEachIndexed(Iterable<T> iterable, BiConsumer<Integer, in T> func)voidforEach(Consumer<in T> func)voidforEachIndexed(BiConsumer<Integer, in T> func)static <T> voidforEachRight(Iterable<T> iterable, Consumer<in T> func)voidforEachRight(Consumer<in T> func)static <T, E> List<T>map(List<E> list, Function<in E, T> func)static <T, E> List<T>mapMulti(List<E> list, BiConsumer<in E, in Consumer<T>> mapper)<F> List<F>map(Function<in T, F> func)static <T> List<T>map(Array<int> array, Function<in Integer, T> func)static <T, E> Set<T>map(Set<E> set, Function<in E, T> func)static <T, E> List<T>mapIndexed(List<E> list, BiFunction<Integer, in E, T> func)static <T> List<T>replace(Iterable<T> iter, Predicate<T> pred, T value)List<T>replace(Predicate<T> pred, T value)static <T> List<T>replaceIndexed(Iterable<T> iter, Underscore.PredicateIndexed<T> pred, T value)List<T>replaceIndexed(Underscore.PredicateIndexed<T> pred, T value)<F> List<F>mapIndexed(BiFunction<Integer, in T, F> func)static <T, E> List<T>collect(List<E> list, Function<in E, T> func)static <T, E> Set<T>collect(Set<E> set, Function<in E, T> func)static <T, E> Ereduce(Iterable<T> iterable, BiFunction<E, T, E> func, E zeroElem)static <T> Optional<T>reduce(Iterable<T> iterable, BinaryOperator<T> func)static <E> Ereduce(Array<int> array, BiFunction<E, in Integer, E> func, E zeroElem)static <T, E> Ereduce(Array<T> array, BiFunction<E, T, E> func, E zeroElem)static <T, E> Efoldl(Iterable<T> iterable, BiFunction<E, T, E> func, E zeroElem)static <T, E> Einject(Iterable<T> iterable, BiFunction<E, T, E> func, E zeroElem)static <T, E> EreduceRight(Iterable<T> iterable, BiFunction<E, T, E> func, E zeroElem)static <T> Optional<T>reduceRight(Iterable<T> iterable, BinaryOperator<T> func)static <E> EreduceRight(Array<int> array, BiFunction<E, in Integer, E> func, E zeroElem)static <T, E> EreduceRight(Array<T> array, BiFunction<E, T, E> func, E zeroElem)static <T, E> Efoldr(Iterable<T> iterable, BiFunction<E, T, E> func, E zeroElem)static <E> Optional<E>find(Iterable<E> iterable, Predicate<E> pred)static <E> Optional<E>detect(Iterable<E> iterable, Predicate<E> pred)static <E> Optional<E>findLast(Iterable<E> iterable, Predicate<E> pred)static <E> List<E>filter(Iterable<E> iterable, Predicate<E> pred)static <E> List<E>filter(List<E> list, Predicate<E> pred)List<T>filter(Predicate<T> pred)static <E> List<E>filterIndexed(List<E> list, Underscore.PredicateIndexed<E> pred)static <E> Set<E>filter(Set<E> set, Predicate<E> pred)static <E> List<E>select(List<E> list, Predicate<E> pred)static <E> Set<E>select(Set<E> set, Predicate<E> pred)static <E> List<E>reject(List<E> list, Predicate<E> pred)List<T>reject(Predicate<T> pred)static <E> List<E>rejectIndexed(List<E> list, Underscore.PredicateIndexed<E> pred)static <E> Set<E>reject(Set<E> set, Predicate<E> pred)static <E> List<E>filterFalse(List<E> list, Predicate<E> pred)List<T>filterFalse(Predicate<T> pred)static <E> Set<E>filterFalse(Set<E> set, Predicate<E> pred)static <E> booleanevery(Iterable<E> iterable, Predicate<E> pred)booleanevery(Predicate<T> pred)static <E> booleanall(Iterable<E> iterable, Predicate<E> pred)booleanall(Predicate<T> pred)static <E> booleansome(Iterable<E> iterable, Predicate<E> pred)booleansome(Predicate<T> pred)static <E> booleanany(Iterable<E> iterable, Predicate<E> pred)booleanany(Predicate<T> pred)static <E> intcount(Iterable<E> iterable, Predicate<E> pred)intcount(Predicate<T> pred)static <E> booleancontains(Iterable<E> iterable, E elem)booleancontains(T elem)static <E> booleancontainsWith(Iterable<E> iterable, E elem)booleancontainsWith(T elem)static <E> booleancontains(Iterable<E> iterable, E elem, int fromIndex)booleancontainsAtLeast(T value, int count)booleancontainsAtMost(T value, int count)static <E> booleancontainsAtLeast(Iterable<E> iterable, E value, int count)static <E> booleancontainsAtMost(Iterable<E> iterable, E value, int count)static <E> booleaninclude(Iterable<E> iterable, E elem)static <E> List<E>invoke(Iterable<E> iterable, String methodName, List<Object> args)List<T>invoke(String methodName, List<Object> args)static <E> List<E>invoke(Iterable<E> iterable, String methodName)List<T>invoke(String methodName)static <E> List<Object>pluck(List<E> list, String propertyName)List<Object>pluck(String propertyName)static <E> Set<Object>pluck(Set<E> set, String propertyName)static <T, E> List<E>where(List<E> list, List<Map.Entry<String, T>> properties)<E> List<T>where(List<Map.Entry<String, E>> properties)static <T, E> Set<E>where(Set<E> set, List<Map.Entry<String, T>> properties)static <T, E> Optional<E>findWhere(Iterable<E> iterable, List<Map.Entry<String, T>> properties)<E> Optional<T>findWhere(List<Map.Entry<String, E>> properties)static <E extends Comparable<in E>> Emax(Collection<E> collection)Tmax()static <E, F extends Comparable> Emax(Collection<E> collection, Function<E, F> func)<F extends Comparable<in F>> Tmax(Function<T, F> func)static <E extends Comparable<in E>> Emin(Collection<E> collection)Tmin()static <E, F extends Comparable> Emin(Collection<E> collection, Function<E, F> func)<F extends Comparable<in F>> Tmin(Function<T, F> func)static <E> List<E>shuffle(Iterable<E> iterable)List<T>shuffle()static <E> Esample(Iterable<E> iterable)Tsample()static <E> Set<E>sample(List<E> list, int howMany)static <T extends Comparable<in T>> List<T>sortWith(Iterable<T> iterable, Comparator<T> comparator)<E extends Comparable<in E>> List<E>sortWith(Comparator<E> comparator)static <E, T extends Comparable<in T>> List<E>sortBy(Iterable<E> iterable, Function<E, T> func)<E, V extends Comparable<in V>> List<E>sortBy(Function<E, V> func)static <K, V extends Comparable<in V>> List<Map<K, V>>sortBy(Iterable<Map<K, V>> iterable, K key)static <K, E> Map<K, List<E>>groupBy(Iterable<E> iterable, Function<E, K> func)<K, E> Map<K, List<E>>groupBy(Function<E, K> func)static <K, E> Map<K, Optional<E>>groupBy(Iterable<E> iterable, Function<E, K> func, BinaryOperator<E> binaryOperator)<K, E> Map<K, Optional<E>>groupBy(Function<E, K> func, BinaryOperator<E> binaryOperator)static <K, E> Map<K, E>associateBy(Iterable<E> iterable, Function<E, K> func)<K, E> Map<K, E>associateBy(Function<E, K> func)static <K, E> Map<K, List<E>>indexBy(Iterable<E> iterable, String property)<K, E> Map<K, List<E>>indexBy(String property)static <K, E> Map<K, Integer>countBy(Iterable<E> iterable, Function<E, K> func)static <K> Map<K, Integer>countBy(Iterable<K> iterable)<K, E> Map<K, Integer>countBy(Function<E, K> func)<K> Map<K, Integer>countBy()static <E> Array<E>toArray(Iterable<E> iterable)<E> Array<E>toArray()static <K, V> Map<K, V>toMap(Iterable<Map.Entry<K, V>> iterable)<K, V> Map<K, V>toMap()static <K, V> Map<K, V>toMap(List<Map.Entry<K, V>> tuples)Map<T, Integer>toCardinalityMap()static <K> Map<K, Integer>toCardinalityMap(Iterable<K> iterable)static intsize(Iterable<out Object> iterable)intsize()static <E> intsize(Array<E> array)static <E> List<List<E>>partition(Iterable<E> iterable, Predicate<E> pred)static <E> Array<List<E>>partition(Array<E> iterable, Predicate<E> pred)TsingleOrNull()TsingleOrNull(Predicate<T> pred)static <E> EsingleOrNull(Iterable<E> iterable)static <E> EsingleOrNull(Iterable<E> iterable, Predicate<E> pred)static <E> Efirst(Iterable<E> iterable)static <E> Efirst(Array<E> array)static <E> List<E>first(List<E> list, int n)Tfirst()List<T>first(int n)static <E> Efirst(Iterable<E> iterable, Predicate<E> pred)static <E> List<E>first(Iterable<E> iterable, Predicate<E> pred, int n)Tfirst(Predicate<T> pred)List<T>first(Predicate<T> pred, int n)static <E> EfirstOrNull(Iterable<E> iterable)TfirstOrNull()static <E> EfirstOrNull(Iterable<E> iterable, Predicate<E> pred)TfirstOrNull(Predicate<T> pred)static <E> Ehead(Iterable<E> iterable)static <E> Ehead(Array<E> array)static <E> List<E>head(List<E> list, int n)Thead()List<T>head(int n)static <E> List<E>initial(List<E> list)static <E> List<E>initial(List<E> list, int n)static <E> Array<E>initial(Array<E> array)static <E> Array<E>initial(Array<E> array, int n)List<T>initial()List<T>initial(int n)static <E> Elast(Array<E> array)static <E> Elast(List<E> list)static <E> List<E>last(List<E> list, int n)Tlast()List<T>last(int n)static <E> Elast(List<E> list, Predicate<E> pred)Tlast(Predicate<T> pred)static <E> ElastOrNull(List<E> list)TlastOrNull()static <E> ElastOrNull(List<E> list, Predicate<E> pred)TlastOrNull(Predicate<T> pred)static <E> List<E>rest(List<E> list)static <E> List<E>rest(List<E> list, int n)static <E> Array<E>rest(Array<E> array)static <E> Array<E>rest(Array<E> array, int n)List<T>rest()List<T>rest(int n)static <E> List<E>tail(List<E> list)static <E> List<E>tail(List<E> list, int n)static <E> Array<E>tail(Array<E> array)static <E> Array<E>tail(Array<E> array, int n)List<T>tail()List<T>tail(int n)static <E> List<E>drop(List<E> list)static <E> List<E>drop(List<E> list, int n)static <E> Array<E>drop(Array<E> array)static <E> Array<E>drop(Array<E> array, int n)static <E> List<E>compact(List<E> list)static <E> Array<E>compact(Array<E> array)static <E> List<E>compactList(List<E> list, E falsyValue)static <E> Array<E>compact(Array<E> array, E falsyValue)List<T>compact()List<T>compact(T falsyValue)static <E> List<E>flatten(List<out Object> list)static <E> List<E>flatten(List<out Object> list, boolean shallow)List<T>flatten()List<T>flatten(boolean shallow)static <E> List<E>without(List<E> list, Array<E> values)static <E> Array<E>without(Array<E> array, Array<E> values)static <E> List<E>uniq(List<E> list)static <E> Array<E>uniq(Array<E> array)static <K, E> Collection<E>uniq(Iterable<E> iterable, Function<E, K> func)static <K, E> Array<E>uniq(Array<E> array, Function<E, K> func)static <E> List<E>distinct(List<E> list)static <E> Array<E>distinct(Array<E> array)static <K, E> Collection<E>distinctBy(Iterable<E> iterable, Function<E, K> func)static <K, E> Array<E>distinctBy(Array<E> array, Function<E, K> func)static <E> List<E>union(List<E> list, Array<List<E>> lists)List<T>unionWith(Array<List<T>> lists)static <E> Array<E>union(Array<Array<E>> arrays)static <E> List<E>intersection(List<E> list1, List<E> list2)static <E> List<E>intersection(List<E> list, Array<List<E>> lists)List<T>intersectionWith(Array<List<T>> lists)static <E> Array<E>intersection(Array<Array<E>> arrays)static <E> List<E>difference(List<E> list1, List<E> list2)static <E> List<E>difference(List<E> list, Array<List<E>> lists)List<T>differenceWith(Array<List<T>> lists)static <E> Array<E>difference(Array<Array<E>> arrays)static <T> List<List<T>>zip(Array<List<T>> lists)static <T> List<List<T>>unzip(Array<List<T>> lists)static <K, V> List<Map.Entry<K, V>>object(List<K> keys, List<V> values)static <E> intfindIndex(List<E> list, Predicate<E> pred)static <E> intfindIndex(Array<E> array, Predicate<E> pred)static <E> intfindLastIndex(List<E> list, Predicate<E> pred)static <E> intfindLastIndex(Array<E> array, Predicate<E> pred)static <E extends Comparable<E>> intbinarySearch(Iterable<E> iterable, E key)static <E extends Comparable<E>> intbinarySearch(Array<E> array, E key)static <E extends Comparable<E>> intsortedIndex(List<E> list, E value)static <E extends Comparable<E>> intsortedIndex(Array<E> array, E value)static <E extends Comparable<E>> intsortedIndex(List<E> list, E value, String propertyName)static <E extends Comparable<E>> intsortedIndex(Array<E> array, E value, String propertyName)static <E> intindexOf(List<E> list, E value)static <E> intindexOf(Array<E> array, E value)static <E> intlastIndexOf(List<E> list, E value)static <E> intlastIndexOf(Array<E> array, E value)static List<Integer>range(int stop)static List<Integer>range(int start, int stop)static List<Integer>range(int start, int stop, int step)static List<Character>range(char stop)static List<Character>range(char start, char stop)static List<Character>range(char start, char stop, int step)static <T> List<List<T>>chunk(Iterable<T> iterable, int size)static <T> List<List<T>>chunk(Iterable<T> iterable, int size, int step)static <T> List<List<T>>chunkFill(Iterable<T> iterable, int size, T fillValue)static <T> List<List<T>>chunkFill(Iterable<T> iterable, int size, int step, T fillValue)List<List<T>>chunk(int size)List<List<T>>chunk(int size, int step)List<List<T>>chunkFill(int size, T fillvalue)List<List<T>>chunkFill(int size, int step, T fillvalue)static <T> List<T>cycle(Iterable<T> iterable, int times)List<T>cycle(int times)static <T> List<T>repeat(T element, int times)static <T> List<T>interpose(Iterable<T> iterable, T interElement)static <T> List<T>interposeByList(Iterable<T> iterable, Iterable<T> interIter)List<T>interpose(T element)List<T>interposeByList(Iterable<T> interIter)static <T, F> Function<F, T>bind(Function<F, T> function)static <T, F> Function<F, T>memoize(Function<F, T> function)static <T> ScheduledFuture<T>delay(Supplier<T> function, int delayMilliseconds)static <T> ScheduledFuture<T>defer(Supplier<T> function)static ScheduledFuture<Void>defer(Runnable runnable)static <T> Supplier<T>throttle(Supplier<T> function, int waitMilliseconds)static <T> Supplier<T>debounce(Supplier<T> function, int delayMilliseconds)static <T> Function<Void, T>wrap(UnaryOperator<T> function, Function<UnaryOperator<T>, T> wrapper)static <E> Predicate<E>negate(Predicate<E> pred)static <T> Function<T, T>compose(Array<Function<T, T>> func)static <E> Supplier<E>after(int count, Supplier<E> function)static <E> Supplier<E>before(int count, Supplier<E> function)static <T> Supplier<T>once(Supplier<T> function)static <K, V> Set<K>keys(Map<K, V> object)static <K, V> Collection<V>values(Map<K, V> object)static <K, V> List<Map.Entry<K, V>>mapObject(Map<K, V> object, Function<in V, V> func)static <K, V> List<Map.Entry<K, V>>pairs(Map<K, V> object)static <K, V> List<Map.Entry<V, K>>invert(Map<K, V> object)static List<String>functions(Object object)static List<String>methods(Object object)static <K, V> Map<K, V>extend(Map<K, V> destination, Array<Map<K, V>> sources)static <E> EfindKey(List<E> list, Predicate<E> pred)static <E> EfindKey(Array<E> array, Predicate<E> pred)static <E> EfindLastKey(List<E> list, Predicate<E> pred)static <E> EfindLastKey(Array<E> array, Predicate<E> pred)static <K, V> List<Map.Entry<K, V>>pick(Map<K, V> object, Array<K> keys)static <K, V> List<Map.Entry<K, V>>pick(Map<K, V> object, Predicate<V> pred)static <K, V> List<Map.Entry<K, V>>omit(Map<K, V> object, Array<K> keys)static <K, V> List<Map.Entry<K, V>>omit(Map<K, V> object, Predicate<V> pred)static <K, V> Map<K, V>defaults(Map<K, V> object, Map<K, V> defaults)static Objectclone(Object obj)static <E> Array<E>clone(Array<E> iterable)static <T> voidtap(Iterable<T> iterable, Consumer<in T> func)static <K, V> booleanisMatch(Map<K, V> object, Map<K, V> properties)static booleanisEqual(Object object, Object other)static <K, V> booleanisEmpty(Map<K, V> object)static <T> booleanisEmpty(Iterable<T> iterable)booleanisEmpty()static <K, V> booleanisNotEmpty(Map<K, V> object)static <T> booleanisNotEmpty(Iterable<T> iterable)booleanisNotEmpty()static booleanisArray(Object object)static booleanisObject(Object object)static booleanisFunction(Object object)static booleanisString(Object object)static booleanisNumber(Object object)static booleanisDate(Object object)static booleanisRegExp(Object object)static booleanisError(Object object)static booleanisBoolean(Object object)static booleanisNull(Object object)static <K, V> booleanhas(Map<K, V> object, K key)static <E> Eidentity(E value)static <E> Supplier<E>constant(E value)static <K, V> Function<Map<K, V>, V>property(K key)static <K, V> Function<K, V>propertyOf(Map<K, V> object)static <K, V> Predicate<Map<K, V>>matcher(Map<K, V> object)static voidtimes(int count, Runnable runnable)static intrandom(int min, int max)static intrandom(int max)static longnow()static Stringescape(String value)static Stringunescape(String value)static <E> Objectresult(Iterable<E> iterable, Predicate<E> pred)static StringuniqueId(String prefix)static StringuniquePassword()static <K, V> Underscore.Template<Map<K, V>>template(String template)static Stringformat(String template, Array<Object> params)static <T> Iterable<T>iterate(T seed, UnaryOperator<T> unaryOperator)static <T> Underscore.Chain<T>chain(List<T> list)static Underscore.Chain<Map<String, Object>>chain(Map<String, Object> map)static <T> Underscore.Chain<T>chain(Iterable<T> iterable)static <T> Underscore.Chain<T>chain(Iterable<T> iterable, int size)static <T> Underscore.Chain<T>chain(Array<T> array)static Underscore.Chain<Integer>chain(Array<int> array)Underscore.Chain<T>chain()static <T> Underscore.Chain<T>of(List<T> list)static <T> Underscore.Chain<T>of(Iterable<T> iterable)static <T> Underscore.Chain<T>of(Iterable<T> iterable, int size)static <T> Underscore.Chain<T>of(Array<T> array)static Underscore.Chain<Integer>of(Array<int> array)Underscore.Chain<T>of()static voidmixin(String funcName, UnaryOperator<String> func)Optional<String>call(String funcName)static <T extends Comparable<T>> List<T>sort(Iterable<T> iterable)static <T extends Comparable<T>> Array<T>sort(Array<T> array)List<Comparable>sort()static <T> Stringjoin(Iterable<T> iterable, String separator)static <T> StringjoinToString(Iterable<T> iterable, String separator, String prefix, String postfix, int limit, String truncated, Function<T, String> transform)static <T> Stringjoin(Iterable<T> iterable)static <T> Stringjoin(Array<T> array, String separator)static <T> Stringjoin(Array<T> array)Stringjoin(String separator)Stringjoin()static <T> List<T>push(List<T> list, Array<T> values)List<T>push(Array<T> values)static <T> Map.Entry<T, List<T>>pop(List<T> list)Map.Entry<T, List<T>>pop()static <T> List<T>unshift(List<T> list, Array<T> values)List<T>unshift(Array<T> values)static <T> Map.Entry<T, List<T>>shift(List<T> list)Map.Entry<T, List<T>>shift()static <T> Array<T>concat(Array<T> first, Array<Array<T>> other)static <T> List<T>concat(Iterable<T> first, Array<Iterable<T>> other)List<T>concatWith(Array<Iterable<T>> other)static <T> List<T>slice(Iterable<T> iterable, int start)static <T> Array<T>slice(Array<T> array, int start)List<T>slice(int start)static <T> List<T>slice(Iterable<T> iterable, int start, int end)static <T> Array<T>slice(Array<T> array, int start, int end)List<T>slice(int start, int end)static <T> List<List<T>>splitAt(Iterable<T> iterable, int position)static <T> List<List<T>>splitAt(Array<T> array, int position)List<List<T>>splitAt(int position)static <T> List<T>takeSkipping(Iterable<T> iterable, int stepSize)static <T> List<T>takeSkipping(Array<T> array, int stepSize)List<T>takeSkipping(int stepSize)static <T> List<T>reverse(Iterable<T> iterable)static <T> Array<T>reverse(Array<T> array)static List<Integer>reverse(Array<int> array)List<T>reverse()Iterable<T>value()static <T> ScheduledFuture<T>setTimeout(Supplier<T> function, int delayMilliseconds)static voidclearTimeout(ScheduledFuture<out Object> scheduledFuture)static <T> ScheduledFuturesetInterval(Supplier<T> function, int delayMilliseconds)static voidclearInterval(ScheduledFuture scheduledFuture)static <T> List<T>copyOf(Iterable<T> iterable)List<T>copyOf()static <T> List<T>copyOfRange(Iterable<T> iterable, int start, int end)List<T>copyOfRange(int start, int end)static <T> TelementAt(List<T> list, int index)TelementAt(int index)static <T> Tget(List<T> list, int index)Tget(int index)static <T> Map.Entry<T, List<T>>set(List<T> list, int index, T value)Map.Entry<T, List<T>>set(int index, T value)static <T> TelementAtOrElse(List<T> list, int index, T defaultValue)TelementAtOrElse(int index, T defaultValue)static <T> TelementAtOrNull(List<T> list, int index)TelementAtOrNull(int index)static <T> intlastIndex(Iterable<T> iterable)static <T> intlastIndex(Array<T> array)static intlastIndex(Array<int> array)static <T> TcheckNotNull(T reference)static <T> List<T>checkNotNullElements(List<T> references)static <T> TcheckNotNull(T reference, Object errorMessage)static booleannonNull(Object obj)static <T> TdefaultTo(T value, T defaultValue)static <T> Predicate<T>and(Predicate<in T> pred1, Predicate<in T> pred2, Array<Predicate<in T>> rest)static <T> Predicate<T>or(Predicate<in T> pred1, Predicate<in T> pred2, Array<Predicate<in T>> rest)static voidmain(Array<String> args)-
-
Method Detail
-
getIterable
Iterable<T> getIterable()
-
templateSettings
static void templateSettings(Map<String, String> templateSettings)
-
eachIndexed
static <T> void eachIndexed(Iterable<T> iterable, BiConsumer<Integer, in T> func)
-
forEachIndexed
static <T> void forEachIndexed(Iterable<T> iterable, BiConsumer<Integer, in T> func)
-
forEachIndexed
void forEachIndexed(BiConsumer<Integer, in T> func)
-
forEachRight
static <T> void forEachRight(Iterable<T> iterable, Consumer<in T> func)
-
forEachRight
void forEachRight(Consumer<in T> func)
-
mapIndexed
static <T, E> List<T> mapIndexed(List<E> list, BiFunction<Integer, in E, T> func)
-
replaceIndexed
static <T> List<T> replaceIndexed(Iterable<T> iter, Underscore.PredicateIndexed<T> pred, T value)
-
replaceIndexed
List<T> replaceIndexed(Underscore.PredicateIndexed<T> pred, T value)
-
mapIndexed
<F> List<F> mapIndexed(BiFunction<Integer, in T, F> func)
-
reduceRight
static <T, E> E reduceRight(Iterable<T> iterable, BiFunction<E, T, E> func, E zeroElem)
-
reduceRight
static <T> Optional<T> reduceRight(Iterable<T> iterable, BinaryOperator<T> func)
-
reduceRight
static <E> E reduceRight(Array<int> array, BiFunction<E, in Integer, E> func, E zeroElem)
-
reduceRight
static <T, E> E reduceRight(Array<T> array, BiFunction<E, T, E> func, E zeroElem)
-
filterIndexed
static <E> List<E> filterIndexed(List<E> list, Underscore.PredicateIndexed<E> pred)
-
rejectIndexed
static <E> List<E> rejectIndexed(List<E> list, Underscore.PredicateIndexed<E> pred)
-
filterFalse
List<T> filterFalse(Predicate<T> pred)
-
containsWith
static <E> boolean containsWith(Iterable<E> iterable, E elem)
-
containsWith
boolean containsWith(T elem)
-
containsAtLeast
boolean containsAtLeast(T value, int count)
-
containsAtMost
boolean containsAtMost(T value, int count)
-
containsAtLeast
static <E> boolean containsAtLeast(Iterable<E> iterable, E value, int count)
-
containsAtMost
static <E> boolean containsAtMost(Iterable<E> iterable, E value, int count)
-
findWhere
static <T, E> Optional<E> findWhere(Iterable<E> iterable, List<Map.Entry<String, T>> properties)
-
max
static <E extends Comparable<in E>> E max(Collection<E> collection)
-
max
static <E, F extends Comparable> E max(Collection<E> collection, Function<E, F> func)
-
min
static <E extends Comparable<in E>> E min(Collection<E> collection)
-
min
static <E, F extends Comparable> E min(Collection<E> collection, Function<E, F> func)
-
sortWith
static <T extends Comparable<in T>> List<T> sortWith(Iterable<T> iterable, Comparator<T> comparator)
-
sortWith
<E extends Comparable<in E>> List<E> sortWith(Comparator<E> comparator)
-
sortBy
static <E, T extends Comparable<in T>> List<E> sortBy(Iterable<E> iterable, Function<E, T> func)
-
sortBy
static <K, V extends Comparable<in V>> List<Map<K, V>> sortBy(Iterable<Map<K, V>> iterable, K key)
-
groupBy
static <K, E> Map<K, Optional<E>> groupBy(Iterable<E> iterable, Function<E, K> func, BinaryOperator<E> binaryOperator)
-
toCardinalityMap
Map<T, Integer> toCardinalityMap()
-
size
int size()
-
singleOrNull
T singleOrNull()
-
singleOrNull
T singleOrNull(Predicate<T> pred)
-
singleOrNull
static <E> E singleOrNull(Iterable<E> iterable)
-
firstOrNull
static <E> E firstOrNull(Iterable<E> iterable)
-
firstOrNull
T firstOrNull()
-
firstOrNull
T firstOrNull(Predicate<T> pred)
-
lastOrNull
static <E> E lastOrNull(List<E> list)
-
lastOrNull
T lastOrNull()
-
lastOrNull
T lastOrNull(Predicate<T> pred)
-
distinctBy
static <K, E> Collection<E> distinctBy(Iterable<E> iterable, Function<E, K> func)
-
findLastIndex
static <E> int findLastIndex(List<E> list, Predicate<E> pred)
-
findLastIndex
static <E> int findLastIndex(Array<E> array, Predicate<E> pred)
-
binarySearch
static <E extends Comparable<E>> int binarySearch(Iterable<E> iterable, E key)
-
binarySearch
static <E extends Comparable<E>> int binarySearch(Array<E> array, E key)
-
sortedIndex
static <E extends Comparable<E>> int sortedIndex(List<E> list, E value)
-
sortedIndex
static <E extends Comparable<E>> int sortedIndex(Array<E> array, E value)
-
sortedIndex
static <E extends Comparable<E>> int sortedIndex(List<E> list, E value, String propertyName)
-
sortedIndex
static <E extends Comparable<E>> int sortedIndex(Array<E> array, E value, String propertyName)
-
lastIndexOf
static <E> int lastIndexOf(List<E> list, E value)
-
lastIndexOf
static <E> int lastIndexOf(Array<E> array, E value)
-
interposeByList
List<T> interposeByList(Iterable<T> interIter)
-
delay
static <T> ScheduledFuture<T> delay(Supplier<T> function, int delayMilliseconds)
-
defer
static <T> ScheduledFuture<T> defer(Supplier<T> function)
-
defer
static ScheduledFuture<Void> defer(Runnable runnable)
-
wrap
static <T> Function<Void, T> wrap(UnaryOperator<T> function, Function<UnaryOperator<T>, T> wrapper)
-
isEmpty
boolean isEmpty()
-
isNotEmpty
static <K, V> boolean isNotEmpty(Map<K, V> object)
-
isNotEmpty
static <T> boolean isNotEmpty(Iterable<T> iterable)
-
isNotEmpty
boolean isNotEmpty()
-
isFunction
static boolean isFunction(Object object)
-
random
static int random(int min, int max)
-
random
static int random(int max)
-
now
static long now()
-
uniquePassword
static String uniquePassword()
-
chain
static <T> Underscore.Chain<T> chain(List<T> list)
-
chain
static <T> Underscore.Chain<T> chain(Iterable<T> iterable)
-
chain
static <T> Underscore.Chain<T> chain(Iterable<T> iterable, int size)
-
chain
static <T> Underscore.Chain<T> chain(Array<T> array)
-
chain
static Underscore.Chain<Integer> chain(Array<int> array)
-
chain
Underscore.Chain<T> chain()
-
of
static <T> Underscore.Chain<T> of(List<T> list)
-
of
static <T> Underscore.Chain<T> of(Iterable<T> iterable)
-
of
static <T> Underscore.Chain<T> of(Iterable<T> iterable, int size)
-
of
static <T> Underscore.Chain<T> of(Array<T> array)
-
of
static Underscore.Chain<Integer> of(Array<int> array)
-
of
Underscore.Chain<T> of()
-
mixin
static void mixin(String funcName, UnaryOperator<String> func)
-
sort
List<Comparable> sort()
-
joinToString
static <T> String joinToString(Iterable<T> iterable, String separator, String prefix, String postfix, int limit, String truncated, Function<T, String> transform)
-
takeSkipping
static <T> List<T> takeSkipping(Iterable<T> iterable, int stepSize)
-
takeSkipping
static <T> List<T> takeSkipping(Array<T> array, int stepSize)
-
takeSkipping
List<T> takeSkipping(int stepSize)
-
setTimeout
static <T> ScheduledFuture<T> setTimeout(Supplier<T> function, int delayMilliseconds)
-
clearTimeout
static void clearTimeout(ScheduledFuture<out Object> scheduledFuture)
-
setInterval
static <T> ScheduledFuture setInterval(Supplier<T> function, int delayMilliseconds)
-
clearInterval
static void clearInterval(ScheduledFuture scheduledFuture)
-
copyOfRange
static <T> List<T> copyOfRange(Iterable<T> iterable, int start, int end)
-
copyOfRange
List<T> copyOfRange(int start, int end)
-
elementAtOrElse
static <T> T elementAtOrElse(List<T> list, int index, T defaultValue)
-
elementAtOrElse
T elementAtOrElse(int index, T defaultValue)
-
elementAtOrNull
static <T> T elementAtOrNull(List<T> list, int index)
-
elementAtOrNull
T elementAtOrNull(int index)
-
checkNotNull
static <T> T checkNotNull(T reference)
-
checkNotNullElements
static <T> List<T> checkNotNullElements(List<T> references)
-
checkNotNull
static <T> T checkNotNull(T reference, Object errorMessage)
-
and
static <T> Predicate<T> and(Predicate<in T> pred1, Predicate<in T> pred2, Array<Predicate<in T>> rest)
-
or
static <T> Predicate<T> or(Predicate<in T> pred1, Predicate<in T> pred2, Array<Predicate<in T>> rest)
-
-
-
-