T - the keyType of elements maintained by this Collectionpublic interface ObjectIterable<T>
extends java.lang.Iterable<T>
Iterable that reduces (un)boxing| Modifier and Type | Method and Description |
|---|---|
default <E> ObjectIterable<E> |
arrayflatMap(UnaryOperator<T,E[]> mapper)
A Helper function to reduce the usage of Streams and allows to convert a Iterable to something else.
|
default ObjectAsyncBuilder<T> |
asAsync()
Creates a Async Builder for moving work of the thread.
|
default int |
count(java.util.function.Predicate<T> filter)
Helper function to reduce stream usage that allows to count the valid elements.
|
default ObjectIterable<T> |
distinct()
A Helper function to reduce the usage of Streams and allows to filter out duplicated elements
|
default ObjectIterable<T> |
filter(java.util.function.Predicate<T> filter)
A Helper function to reduce the usage of Streams and allows to filter out unwanted elements
|
default T |
findFirst(java.util.function.Predicate<T> filter)
Helper function to reduce stream usage that allows to filter for the first match.
|
default <E,V extends java.lang.Iterable<E>> |
flatMap(UnaryOperator<T,V> mapper)
A Helper function to reduce the usage of Streams and allows to convert a Iterable to something else.
|
default <E> void |
forEach(E input,
ObjectObjectConsumer<E,T> action)
Helper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner.
|
default void |
forEachIndexed(IntObjectConsumer<T> action)
A Indexed forEach implementation that allows you to keep track of how many elements were already iterated over.
|
ObjectIterator<T> |
iterator()
Returns an iterator over elements of type
T. |
default ObjectIterable<T> |
limit(long limit)
A Helper function to reduce the usage of Streams and allows to limit the amount of elements
|
default <E> ObjectIterable<E> |
map(UnaryOperator<T,E> mapper)
A Helper function to reduce the usage of Streams and allows to convert a Iterable to something else.
|
default boolean |
matchesAll(java.util.function.Predicate<T> filter)
Helper function to reduce stream usage that allows to filter for all matches.
|
default boolean |
matchesAny(java.util.function.Predicate<T> filter)
Helper function to reduce stream usage that allows to filter for any matches.
|
default boolean |
matchesNone(java.util.function.Predicate<T> filter)
Helper function to reduce stream usage that allows to filter for no matches.
|
default ObjectIterable<T> |
peek(java.util.function.Consumer<T> action)
A Helper function to reduce the usage of Streams and allows to preview elements before they are iterated through
|
default <E extends ObjectCollection<T>> |
pour(E collection)
A Helper function to reduce the usage of Streams and allows to collect all elements
|
default ObjectList<T> |
pourAsList()
A Helper function that reduces the usage of streams and allows to collect all elements as a ArrayList
|
default ObjectSet<T> |
pourAsSet()
A Helper function that reduces the usage of streams and allows to collect all elements as a LinkedHashSet
|
default <E> E |
reduce(E identity,
java.util.function.BiFunction<E,T,E> operator)
Performs a reduction on the
elements of this Iterable
|
default T |
reduce(ObjectObjectUnaryOperator<T,T> operator)
Performs a reduction on the
elements of this Iterable
|
default ObjectIterable<T> |
repeat(int repeats)
A Helper function to reduce the usage of Streams and allows to repeat elements a desired amount of times
|
default ObjectIterable<T> |
sorted(java.util.Comparator<T> sorter)
A Helper function to reduce the usage of Streams and allows to sort the elements
|
default ObjectSplititerator<T> |
spliterator()
A Type Specific Type Splititerator to reduce boxing/unboxing
|
default <E> E[] |
toArray(java.util.function.IntFunction<E[]> action)
A Helper function that reduces the usage of streams and allows to collect all elements as a Array
|
ObjectIterator<T> iterator()
T.iterator in interface java.lang.Iterable<T>default void forEachIndexed(IntObjectConsumer<T> action)
action - The action to be performed for each elementjava.lang.NullPointerException - if the specified action is nulldefault <E> void forEach(E input,
ObjectObjectConsumer<E,T> action)
E - the generic type of the Objectinput - the object that should be includedaction - The action to be performed for each elementjava.lang.NullPointerException - if the specified action is nulldefault ObjectSplititerator<T> spliterator()
spliterator in interface java.lang.Iterable<T>default ObjectAsyncBuilder<T> asAsync()
ObjectAsyncBuilderdefault <E> ObjectIterable<E> map(UnaryOperator<T,E> mapper)
E - The return type.mapper - the mapping functiondefault <E,V extends java.lang.Iterable<E>> ObjectIterable<E> flatMap(UnaryOperator<T,V> mapper)
V - The return type supplier.E - The return type.mapper - the flatMapping functiondefault <E> ObjectIterable<E> arrayflatMap(UnaryOperator<T,E[]> mapper)
E - The return type.mapper - the flatMapping functiondefault ObjectIterable<T> filter(java.util.function.Predicate<T> filter)
filter - the elements that should be kept.default ObjectIterable<T> distinct()
default ObjectIterable<T> repeat(int repeats)
repeats - how many times the elements should be repeateddefault ObjectIterable<T> limit(long limit)
limit - the amount of elements it should be limited todefault ObjectIterable<T> sorted(java.util.Comparator<T> sorter)
sorter - that sorts the elements.default ObjectIterable<T> peek(java.util.function.Consumer<T> action)
action - the action that should be applieddefault <E extends ObjectCollection<T>> E pour(E collection)
E - the collection typecollection - that the elements should be inserted todefault ObjectList<T> pourAsList()
default ObjectSet<T> pourAsSet()
default <E> E[] toArray(java.util.function.IntFunction<E[]> action)
action - is the creator function of said Array to ensure type is kept.default boolean matchesAny(java.util.function.Predicate<T> filter)
filter - that should be applieddefault boolean matchesNone(java.util.function.Predicate<T> filter)
filter - that should be applieddefault boolean matchesAll(java.util.function.Predicate<T> filter)
filter - that should be applieddefault T findFirst(java.util.function.Predicate<T> filter)
filter - that should be applieddefault <E> E reduce(E identity,
java.util.function.BiFunction<E,T,E> operator)
E - the keyType of elements maintained by this Collectionoperator - the operation that should be appliedidentity - the start valuedefault T reduce(ObjectObjectUnaryOperator<T,T> operator)
operator - the operation that should be applieddefault int count(java.util.function.Predicate<T> filter)
filter - that should be applied