public class KMongoIterableKt
public static <T,R> R useCursor(@NotNull
com.mongodb.client.MongoIterable<T> $this$useCursor,
@NotNull
kotlin.jvm.functions.Function1<? super java.lang.Iterable<? extends T>,? extends R> block)
Utility method - this is not part of the KMongo public API.
public static <T> void forEach(@NotNull
com.mongodb.client.MongoIterable<T> $this$forEach,
@NotNull
kotlin.jvm.functions.Function1<? super T,kotlin.Unit> action)
Overrides Iterable.forEach to ensure MongoIterable.forEach is called.
@Nullable
public static <T> T firstOrNull(@NotNull
com.mongodb.client.MongoIterable<T> $this$firstOrNull)
Returns the first element, or null if the collection is empty.
@NotNull
public static <T> com.mongodb.client.MongoIterable<kotlin.collections.IndexedValue> withIndex(@NotNull
com.mongodb.client.MongoIterable<T> $this$withIndex)
Returns a lazy Iterable of IndexedValue for each element of the original collection.
@NotNull
public static <T> com.mongodb.client.MongoCursor<kotlin.collections.IndexedValue> withIndex(@NotNull
com.mongodb.client.MongoCursor<T> $this$withIndex)
Returns an Iterator wrapping each value produced by this Iterator with the IndexedValue, containing value and it's index.
//Unresolved: samples.collections.Iterators.withIndexIterator
@NotNull
public static <T> java.lang.Iterable<T> requireNoNulls(@NotNull
com.mongodb.client.MongoIterable<T> $this$requireNoNulls)
Returns an original collection containing all the non-null elements, throwing an IllegalArgumentException if there are any null elements.
@NotNull
public static <T> kotlin.sequences.Sequence<T> asSequence(@NotNull
com.mongodb.client.MongoIterable<T> $this$asSequence)
Creates a Sequence instance that wraps the original collection returning its elements when being iterated.
//Unresolved: samples.collections.Sequences.Building.sequenceFromCollection
public static <T> boolean contains(@NotNull
com.mongodb.client.MongoIterable<T> $this$contains,
T element)
Returns true if element is found in the collection.
public static <T> T elementAt(@NotNull
com.mongodb.client.MongoIterable<T> $this$elementAt,
int index)
Returns an element at the given index or throws an IndexOutOfBoundsException if the index is out of bounds of this collection.
public static <T> T elementAtOrElse(@NotNull
com.mongodb.client.MongoIterable<T> $this$elementAtOrElse,
int index,
@NotNull
kotlin.jvm.functions.Function1<? super java.lang.Integer,? extends T> defaultValue)
Returns an element at the given index or the result of calling the defaultValue function if the index is out of bounds of this collection.
@Nullable
public static <T> T elementAtOrNull(@NotNull
com.mongodb.client.MongoIterable<T> $this$elementAtOrNull,
int index)
public static <T> T first(@NotNull
com.mongodb.client.MongoIterable<T> $this$first,
@NotNull
kotlin.jvm.functions.Function1<? super T,java.lang.Boolean> predicate)
Returns the first element matching the given predicate.
NoSuchElementException - if no such element is found.@Nullable
public static <T> T firstOrNull(@NotNull
com.mongodb.client.MongoIterable<T> $this$firstOrNull,
@NotNull
kotlin.jvm.functions.Function1<? super T,java.lang.Boolean> predicate)
Returns the first element matching the given predicate, or null if element was not found.
public static <T> int indexOf(@NotNull
com.mongodb.client.MongoIterable<T> $this$indexOf,
T element)
Returns first index of element, or -1 if the collection does not contain element.
public static <T> int indexOfFirst(@NotNull
com.mongodb.client.MongoIterable<T> $this$indexOfFirst,
@NotNull
kotlin.jvm.functions.Function1<? super T,java.lang.Boolean> predicate)
Returns index of the first element matching the given predicate, or -1 if the collection does not contain such element.
public static <T> int indexOfLast(@NotNull
com.mongodb.client.MongoIterable<T> $this$indexOfLast,
@NotNull
kotlin.jvm.functions.Function1<? super T,java.lang.Boolean> predicate)
Returns index of the last element matching the given predicate, or -1 if the collection does not contain such element.
public static <T> T last(@NotNull
com.mongodb.client.MongoIterable<T> $this$last)
Returns the last element.
NoSuchElementException - if the collection is empty.public static <T> T last(@NotNull
com.mongodb.client.MongoIterable<T> $this$last,
@NotNull
kotlin.jvm.functions.Function1<? super T,java.lang.Boolean> predicate)
Returns the last element matching the given predicate.
NoSuchElementException - if no such element is found.public static <T> int lastIndexOf(@NotNull
com.mongodb.client.MongoIterable<T> $this$lastIndexOf,
T element)
Returns last index of element, or -1 if the collection does not contain element.
@Nullable
public static <T> T lastOrNull(@NotNull
com.mongodb.client.MongoIterable<T> $this$lastOrNull)
Returns the last element, or null if the collection is empty.
@Nullable
public static <T> T lastOrNull(@NotNull
com.mongodb.client.MongoIterable<T> $this$lastOrNull,
@NotNull
kotlin.jvm.functions.Function1<? super T,java.lang.Boolean> predicate)
Returns the last element matching the given predicate, or null if no such element was found.
public static <T> T single(@NotNull
com.mongodb.client.MongoIterable<T> $this$single)
Returns the single element, or throws an exception if the collection is empty or has more than one element.
public static <T> T single(@NotNull
com.mongodb.client.MongoIterable<T> $this$single,
@NotNull
kotlin.jvm.functions.Function1<? super T,java.lang.Boolean> predicate)
Returns the single element matching the given predicate, or throws exception if there is no or more than one matching element.
@Nullable
public static <T> T singleOrNull(@NotNull
com.mongodb.client.MongoIterable<T> $this$singleOrNull)
Returns single element, or null if the collection is empty or has more than one element.
@Nullable
public static <T> T singleOrNull(@NotNull
com.mongodb.client.MongoIterable<T> $this$singleOrNull,
@NotNull
kotlin.jvm.functions.Function1<? super T,java.lang.Boolean> predicate)
Returns the single element matching the given predicate, or null if element was not found or more than one element was found.
@NotNull
public static <T> java.util.List<T> drop(@NotNull
com.mongodb.client.MongoIterable<T> $this$drop,
int n)
Returns a list containing all elements except first n elements.
//Unresolved: samples.collections.Collections.Transformations.drop
@NotNull
public static <T> java.util.List<T> dropWhile(@NotNull
com.mongodb.client.MongoIterable<T> $this$dropWhile,
@NotNull
kotlin.jvm.functions.Function1<? super T,java.lang.Boolean> predicate)
Returns a list containing all elements except first elements that satisfy the given predicate.
//Unresolved: samples.collections.Collections.Transformations.drop
@NotNull
public static <T> java.util.List<T> filter(@NotNull
com.mongodb.client.MongoIterable<T> $this$filter,
@NotNull
kotlin.jvm.functions.Function1<? super T,java.lang.Boolean> predicate)
Returns a list containing only elements matching the given predicate.
@NotNull
public static <T> java.util.List<T> filterIndexed(@NotNull
com.mongodb.client.MongoIterable<T> $this$filterIndexed,
@NotNull
kotlin.jvm.functions.Function2<? super java.lang.Integer,? super T,java.lang.Boolean> predicate)
Returns a list containing only elements matching the given predicate.
predicate - function that takes the index of an element and the element itselfand returns the result of predicate evaluation on the element.@NotNull public static <T,C extends Collection<? super T>> C filterIndexedTo(@NotNull com.mongodb.client.MongoIterable<T> $this$filterIndexedTo, @NotNull C destination, @NotNull kotlin.jvm.functions.Function2<? super java.lang.Integer,? super T,java.lang.Boolean> predicate)
Appends all elements matching the given predicate to the given destination.
predicate - function that takes the index of an element and the element itselfand returns the result of predicate evaluation on the element.@NotNull
public static <T> java.util.List<T> filterNot(@NotNull
com.mongodb.client.MongoIterable<T> $this$filterNot,
@NotNull
kotlin.jvm.functions.Function1<? super T,java.lang.Boolean> predicate)
Returns a list containing all elements not matching the given predicate.
@NotNull
public static <T> java.util.List<T> filterNotNull(@NotNull
com.mongodb.client.MongoIterable<T> $this$filterNotNull)
Returns a list containing all elements that are not null.
@NotNull public static <C extends Collection<? super T>,T> C filterNotNullTo(@NotNull com.mongodb.client.MongoIterable<T> $this$filterNotNullTo, @NotNull C destination)
Appends all elements that are not null to the given destination.
@NotNull public static <T,C extends Collection<? super T>> C filterNotTo(@NotNull com.mongodb.client.MongoIterable<T> $this$filterNotTo, @NotNull C destination, @NotNull kotlin.jvm.functions.Function1<? super T,java.lang.Boolean> predicate)
Appends all elements not matching the given predicate to the given destination.
@NotNull public static <T,C extends Collection<? super T>> C filterTo(@NotNull com.mongodb.client.MongoIterable<T> $this$filterTo, @NotNull C destination, @NotNull kotlin.jvm.functions.Function1<? super T,java.lang.Boolean> predicate)
Appends all elements matching the given predicate to the given destination.
@NotNull
public static <T> java.util.List<T> take(@NotNull
com.mongodb.client.MongoIterable<T> $this$take,
int n)
Returns a list containing first n elements.
//Unresolved: samples.collections.Collections.Transformations.take
@NotNull
public static <T> java.util.List<T> takeWhile(@NotNull
com.mongodb.client.MongoIterable<T> $this$takeWhile,
@NotNull
kotlin.jvm.functions.Function1<? super T,java.lang.Boolean> predicate)
Returns a list containing first elements satisfying the given predicate.
//Unresolved: samples.collections.Collections.Transformations.take
@NotNull
public static <T> java.util.List<T> reversed(@NotNull
com.mongodb.client.MongoIterable<T> $this$reversed)
Returns a list with elements in reversed order.
@NotNull public static <T extends Comparable<? super T>> java.util.List<T> sorted(@NotNull com.mongodb.client.MongoIterable<T> $this$sorted)
Returns a list of all elements sorted according to their natural sort order.
@NotNull public static <T,R extends Comparable<? super R>> java.util.List<T> sortedBy(@NotNull com.mongodb.client.MongoIterable<T> $this$sortedBy, @NotNull kotlin.jvm.functions.Function1<? super T,? extends R> selector)
Returns a list of all elements sorted according to natural sort order of the value returned by specified selector function.
@NotNull public static <T,R extends Comparable<? super R>> java.util.List<T> sortedByDescending(@NotNull com.mongodb.client.MongoIterable<T> $this$sortedByDescending, @NotNull kotlin.jvm.functions.Function1<? super T,? extends R> selector)
Returns a list of all elements sorted descending according to natural sort order of the value returned by specified selector function.
@NotNull public static <T extends Comparable<? super T>> java.util.List<T> sortedDescending(@NotNull com.mongodb.client.MongoIterable<T> $this$sortedDescending)
Returns a list of all elements sorted descending according to their natural sort order.
@NotNull
public static <T> java.util.List<T> sortedWith(@NotNull
com.mongodb.client.MongoIterable<T> $this$sortedWith,
@NotNull
java.util.Comparator<? super T> comparator)
Returns a list of all elements sorted according to the specified comparator.
@NotNull
public static <T,K,V> java.util.Map<K,V> associate(@NotNull
com.mongodb.client.MongoIterable<T> $this$associate,
@NotNull
kotlin.jvm.functions.Function1<? super T,? extends kotlin.Pair<? extends K,? extends V>> transform)
@NotNull
public static <T,K> java.util.Map<K,T> associateBy(@NotNull
com.mongodb.client.MongoIterable<T> $this$associateBy,
@NotNull
kotlin.jvm.functions.Function1<? super T,? extends K> keySelector)
Returns a Map containing the elements from the given collection indexed by the key returned from keySelector function applied to each element.
If any two elements would have the same key returned by keySelector the last one gets added to the map.
The returned map preserves the entry iteration order of the original collection.
@NotNull
public static <T,K,V> java.util.Map<K,V> associateBy(@NotNull
com.mongodb.client.MongoIterable<T> $this$associateBy,
@NotNull
kotlin.jvm.functions.Function1<? super T,? extends K> keySelector,
@NotNull
kotlin.jvm.functions.Function1<? super T,? extends V> valueTransform)
Returns a Map containing the values provided by valueTransform and indexed by keySelector functions applied to elements of the given collection.
If any two elements would have the same key returned by keySelector the last one gets added to the map.
The returned map preserves the entry iteration order of the original collection.
@NotNull public static <T,K,M extends Map<? super K,? super T>> M associateByTo(@NotNull com.mongodb.client.MongoIterable<T> $this$associateByTo, @NotNull M destination, @NotNull kotlin.jvm.functions.Function1<? super T,? extends K> keySelector)
Populates and returns the destination mutable map with key-value pairs, where key is provided by the keySelector function applied to each element of the given collection and value is the element itself.
If any two elements would have the same key returned by keySelector the last one gets added to the map.
@NotNull public static <T,K,V,M extends Map<? super K,? super V>> M associateByTo(@NotNull com.mongodb.client.MongoIterable<T> $this$associateByTo, @NotNull M destination, @NotNull kotlin.jvm.functions.Function1<? super T,? extends K> keySelector, @NotNull kotlin.jvm.functions.Function1<? super T,? extends V> valueTransform)
Populates and returns the destination mutable map with key-value pairs, where key is provided by the keySelector function and and value is provided by the valueTransform function applied to elements of the given collection.
If any two elements would have the same key returned by keySelector the last one gets added to the map.
@NotNull public static <T,K,V,M extends Map<? super K,? super V>> M associateTo(@NotNull com.mongodb.client.MongoIterable<T> $this$associateTo, @NotNull M destination, @NotNull kotlin.jvm.functions.Function1<? super T,? extends kotlin.Pair<? extends K,? extends V>> transform)
Populates and returns the destination mutable map with key-value pairs provided by transform function applied to each element of the given collection.
If any of two pairs would have the same key the last one gets added to the map.
@NotNull public static <T,C extends Collection<? super T>> C toCollection(@NotNull com.mongodb.client.MongoIterable<T> $this$toCollection, @NotNull C destination)
Appends all elements to the given destination collection.
@NotNull
public static <T> java.util.HashSet<T> toHashSet(@NotNull
com.mongodb.client.MongoIterable<T> $this$toHashSet)
Returns a HashSet of all elements.
@NotNull
public static <T> java.util.List<T> toList(@NotNull
com.mongodb.client.MongoIterable<T> $this$toList)
Returns a List containing all elements.
@NotNull
public static <T> java.util.List<T> toMutableList(@NotNull
com.mongodb.client.MongoIterable<T> $this$toMutableList)
Returns a MutableList filled with all elements of this collection.
@NotNull
public static <T> java.util.Set<T> toSet(@NotNull
com.mongodb.client.MongoIterable<T> $this$toSet)
Returns a Set of all elements.
The returned set preserves the element iteration order of the original collection.
@NotNull
public static <T,R> java.util.List<R> flatMap(@NotNull
com.mongodb.client.MongoIterable<T> $this$flatMap,
@NotNull
kotlin.jvm.functions.Function1<? super T,? extends com.mongodb.client.MongoIterable<R>> transform)
Returns a single list of all elements yielded from results of transform function being invoked on each element of original collection.
@NotNull public static <T,R,C extends Collection<? super R>> C flatMapTo(@NotNull com.mongodb.client.MongoIterable<T> $this$flatMapTo, @NotNull C destination, @NotNull kotlin.jvm.functions.Function1<? super T,? extends com.mongodb.client.MongoIterable<R>> transform)
Appends all elements yielded from results of transform function being invoked on each element of original collection, to the given destination.
@NotNull
public static <T,K> java.util.Map<K,java.util.List> groupBy(@NotNull
com.mongodb.client.MongoIterable<T> $this$groupBy,
@NotNull
kotlin.jvm.functions.Function1<? super T,? extends K> keySelector)
Groups elements of the original collection by the key returned by the given keySelector function applied to each element and returns a map where each group key is associated with a list of corresponding elements.
The returned map preserves the entry iteration order of the keys produced from the original collection.
//Unresolved: samples.collections.Collections.Transformations.groupBy
@NotNull
public static <T,K,V> java.util.Map<K,java.util.List> groupBy(@NotNull
com.mongodb.client.MongoIterable<T> $this$groupBy,
@NotNull
kotlin.jvm.functions.Function1<? super T,? extends K> keySelector,
@NotNull
kotlin.jvm.functions.Function1<? super T,? extends V> valueTransform)
Groups values returned by the valueTransform function applied to each element of the original collection by the key returned by the given keySelector function applied to the element and returns a map where each group key is associated with a list of corresponding values.
The returned map preserves the entry iteration order of the keys produced from the original collection.
//Unresolved: samples.collections.Collections.Transformations.groupByKeysAndValues
@NotNull public static <T,K,M extends Map<? super K,java.util.List>> M groupByTo(@NotNull com.mongodb.client.MongoIterable<T> $this$groupByTo, @NotNull M destination, @NotNull kotlin.jvm.functions.Function1<? super T,? extends K> keySelector)
Groups elements of the original collection by the key returned by the given keySelector function applied to each element and puts to the destination map each group key associated with a list of corresponding elements.
//Unresolved: samples.collections.Collections.Transformations.groupBy
@NotNull public static <T,K,V,M extends Map<? super K,java.util.List>> M groupByTo(@NotNull com.mongodb.client.MongoIterable<T> $this$groupByTo, @NotNull M destination, @NotNull kotlin.jvm.functions.Function1<? super T,? extends K> keySelector, @NotNull kotlin.jvm.functions.Function1<? super T,? extends V> valueTransform)
Groups values returned by the valueTransform function applied to each element of the original collection by the key returned by the given keySelector function applied to the element and puts to the destination map each group key associated with a list of corresponding values.
//Unresolved: samples.collections.Collections.Transformations.groupByKeysAndValues
@SinceKotlin
@NotNull
public static <T,K> kotlin.collections.Grouping<T,K> groupingBy(@NotNull
com.mongodb.client.MongoIterable<T> $this$groupingBy,
@NotNull
kotlin.jvm.functions.Function1<? super T,? extends K> keySelector)
Creates a Grouping source from a collection to be used later with one of group-and-fold operations using the specified keySelector function to extract a key from each element.
//Unresolved: samples.collections.Collections.Transformations.groupingByEachCount
@NotNull
public static <T,R> java.util.List<R> map(@NotNull
com.mongodb.client.MongoIterable<T> $this$map,
@NotNull
kotlin.jvm.functions.Function1<? super T,? extends R> transform)
Returns a list containing the results of applying the given transform function to each element in the original collection.
@NotNull
public static <T,R> java.util.List<R> mapIndexed(@NotNull
com.mongodb.client.MongoIterable<T> $this$mapIndexed,
@NotNull
kotlin.jvm.functions.Function2<? super java.lang.Integer,? super T,? extends R> transform)
Returns a list containing the results of applying the given transform function to each element and its index in the original collection.
transform - function that takes the index of an element and the element itselfand returns the result of the transform applied to the element.@NotNull
public static <T,R> java.util.List<R> mapIndexedNotNull(@NotNull
com.mongodb.client.MongoIterable<T> $this$mapIndexedNotNull,
@NotNull
kotlin.jvm.functions.Function2<? super java.lang.Integer,? super T,? extends R> transform)
Returns a list containing only the non-null results of applying the given transform function to each element and its index in the original collection.
transform - function that takes the index of an element and the element itselfand returns the result of the transform applied to the element.@NotNull public static <T,R,C extends Collection<? super R>> C mapIndexedNotNullTo(@NotNull com.mongodb.client.MongoIterable<T> $this$mapIndexedNotNullTo, @NotNull C destination, @NotNull kotlin.jvm.functions.Function2<? super java.lang.Integer,? super T,? extends R> transform)
Applies the given transform function to each element and its index in the original collection and appends only the non-null results to the given destination.
transform - function that takes the index of an element and the element itselfand returns the result of the transform applied to the element.@NotNull public static <T,R,C extends Collection<? super R>> C mapIndexedTo(@NotNull com.mongodb.client.MongoIterable<T> $this$mapIndexedTo, @NotNull C destination, @NotNull kotlin.jvm.functions.Function2<? super java.lang.Integer,? super T,? extends R> transform)
Applies the given transform function to each element and its index in the original collection and appends the results to the given destination.
transform - function that takes the index of an element and the element itselfand returns the result of the transform applied to the element.@NotNull
public static <T,R> java.util.List<R> mapNotNull(@NotNull
com.mongodb.client.MongoIterable<T> $this$mapNotNull,
@NotNull
kotlin.jvm.functions.Function1<? super T,? extends R> transform)
Returns a list containing only the non-null results of applying the given transform function to each element in the original collection.
@NotNull public static <T,R,C extends Collection<? super R>> C mapNotNullTo(@NotNull com.mongodb.client.MongoIterable<T> $this$mapNotNullTo, @NotNull C destination, @NotNull kotlin.jvm.functions.Function1<? super T,? extends R> transform)
Applies the given transform function to each element in the original collection and appends only the non-null results to the given destination.
@NotNull public static <T,R,C extends Collection<? super R>> C mapTo(@NotNull com.mongodb.client.MongoIterable<T> $this$mapTo, @NotNull C destination, @NotNull kotlin.jvm.functions.Function1<? super T,? extends R> transform)
Applies the given transform function to each element of the original collection and appends the results to the given destination.
@NotNull
public static <T> java.util.List<T> distinct(@NotNull
com.mongodb.client.MongoIterable<T> $this$distinct)
Returns a list containing only distinct elements from the given collection.
The elements in the resulting list are in the same order as they were in the source collection.
@NotNull
public static <T,K> java.util.List<T> distinctBy(@NotNull
com.mongodb.client.MongoIterable<T> $this$distinctBy,
@NotNull
kotlin.jvm.functions.Function1<? super T,? extends K> selector)
Returns a list containing only elements from the given collection having distinct keys returned by the given selector function.
The elements in the resulting list are in the same order as they were in the source collection.
@NotNull
public static <T> java.util.Set<T> intersect(@NotNull
com.mongodb.client.MongoIterable<T> $this$intersect,
@NotNull
java.lang.Iterable<? extends T> other)
Returns a set containing all elements that are contained by both this set and the specified collection.
The returned set preserves the element iteration order of the original collection.
@NotNull
public static <T> java.util.Set<T> subtract(@NotNull
com.mongodb.client.MongoIterable<T> $this$subtract,
@NotNull
java.lang.Iterable<? extends T> other)
Returns a set containing all elements that are contained by this collection and not contained by the specified collection.
The returned set preserves the element iteration order of the original collection.
@NotNull
public static <T> java.util.Set<T> toMutableSet(@NotNull
com.mongodb.client.MongoIterable<T> $this$toMutableSet)
Returns a mutable set containing all distinct elements from the given collection.
The returned set preserves the element iteration order of the original collection.
@NotNull
public static <T> java.util.Set<T> union(@NotNull
com.mongodb.client.MongoIterable<T> $this$union,
@NotNull
java.lang.Iterable<? extends T> other)
public static <T> boolean all(@NotNull
com.mongodb.client.MongoIterable<T> $this$all,
@NotNull
kotlin.jvm.functions.Function1<? super T,java.lang.Boolean> predicate)
Returns true if all elements match the given predicate.
//Unresolved: samples.collections.Collections.Aggregates.all
public static <T> boolean any(@NotNull
com.mongodb.client.MongoIterable<T> $this$any)
Returns true if collection has at least one element.
//Unresolved: samples.collections.Collections.Aggregates.any
public static <T> boolean any(@NotNull
com.mongodb.client.MongoIterable<T> $this$any,
@NotNull
kotlin.jvm.functions.Function1<? super T,java.lang.Boolean> predicate)
Returns true if at least one element matches the given predicate.
//Unresolved: samples.collections.Collections.Aggregates.anyWithPredicate
public static <T> int count(@NotNull
com.mongodb.client.MongoIterable<T> $this$count)
Returns the number of elements in this collection.
public static <T> int count(@NotNull
com.mongodb.client.MongoIterable<T> $this$count,
@NotNull
kotlin.jvm.functions.Function1<? super T,java.lang.Boolean> predicate)
Returns the number of elements matching the given predicate.
public static <T,R> R fold(@NotNull
com.mongodb.client.MongoIterable<T> $this$fold,
R initial,
@NotNull
kotlin.jvm.functions.Function2<? super R,? super T,? extends R> operation)
public static <T,R> R foldIndexed(@NotNull
com.mongodb.client.MongoIterable<T> $this$foldIndexed,
R initial,
@NotNull
kotlin.jvm.functions.Function3<? super java.lang.Integer,? super R,? super T,? extends R> operation)
public static <T> void forEachIndexed(@NotNull
com.mongodb.client.MongoIterable<T> $this$forEachIndexed,
@NotNull
kotlin.jvm.functions.Function2<? super java.lang.Integer,? super T,kotlin.Unit> action)
Performs the given action on each element, providing sequential index with the element.
action - function that takes the index of an element and the element itselfand performs the desired action on the element.@SinceKotlin
@Nullable
public static java.lang.Double max(@NotNull
com.mongodb.client.MongoIterable<java.lang.Double> $this$max)
Returns the largest element or null if there are no elements.
If any of elements is NaN returns NaN.
@SinceKotlin
@Nullable
public static java.lang.Float max(@NotNull
com.mongodb.client.MongoIterable<java.lang.Float> $this$max)
Returns the largest element or null if there are no elements.
If any of elements is NaN returns NaN.
@Nullable public static <T extends Comparable<? super T>> T max(@NotNull com.mongodb.client.MongoIterable<T> $this$max)
Returns the largest element or null if there are no elements.
@Nullable public static <T,R extends Comparable<? super R>> T maxBy(@NotNull com.mongodb.client.MongoIterable<T> $this$maxBy, @NotNull kotlin.jvm.functions.Function1<? super T,? extends R> selector)
Returns the first element yielding the largest value of the given function or null if there are no elements.
@Nullable
public static <T> T maxWith(@NotNull
com.mongodb.client.MongoIterable<T> $this$maxWith,
@NotNull
java.util.Comparator<? super T> comparator)
Returns the first element having the largest value according to the provided comparator or null if there are no elements.
@SinceKotlin
@Nullable
public static java.lang.Double min(@NotNull
com.mongodb.client.MongoIterable<java.lang.Double> $this$min)
Returns the smallest element or null if there are no elements.
If any of elements is NaN returns NaN.
@SinceKotlin
@Nullable
public static java.lang.Float min(@NotNull
com.mongodb.client.MongoIterable<java.lang.Float> $this$min)
Returns the smallest element or null if there are no elements.
If any of elements is NaN returns NaN.
@Nullable public static <T extends Comparable<? super T>> T min(@NotNull com.mongodb.client.MongoIterable<T> $this$min)
Returns the smallest element or null if there are no elements.
@Nullable public static <T,R extends Comparable<? super R>> T minBy(@NotNull com.mongodb.client.MongoIterable<T> $this$minBy, @NotNull kotlin.jvm.functions.Function1<? super T,? extends R> selector)
Returns the first element yielding the smallest value of the given function or null if there are no elements.
@Nullable
public static <T> T minWith(@NotNull
com.mongodb.client.MongoIterable<T> $this$minWith,
@NotNull
java.util.Comparator<? super T> comparator)
Returns the first element having the smallest value according to the provided comparator or null if there are no elements.
public static <T> boolean none(@NotNull
com.mongodb.client.MongoIterable<T> $this$none)
Returns true if the collection has no elements.
//Unresolved: samples.collections.Collections.Aggregates.none
public static <T> boolean none(@NotNull
com.mongodb.client.MongoIterable<T> $this$none,
@NotNull
kotlin.jvm.functions.Function1<? super T,java.lang.Boolean> predicate)
Returns true if no elements match the given predicate.
//Unresolved: samples.collections.Collections.Aggregates.noneWithPredicate
public static <S,T extends S> S reduce(@NotNull com.mongodb.client.MongoIterable<T> $this$reduce, @NotNull kotlin.jvm.functions.Function2<? super S,? super T,? extends S> operation)
Accumulates value starting with the first element and applying operation from left to right to current accumulator value and each element.
public static <S,T extends S> S reduceIndexed(@NotNull com.mongodb.client.MongoIterable<T> $this$reduceIndexed, @NotNull kotlin.jvm.functions.Function3<? super java.lang.Integer,? super S,? super T,? extends S> operation)
Accumulates value starting with the first element and applying operation from left to right to current accumulator value and each element with its index in the original collection.
operation - function that takes the index of an element, current accumulator valueand the element itself and calculates the next accumulator value.public static <T> int sumBy(@NotNull
com.mongodb.client.MongoIterable<T> $this$sumBy,
@NotNull
kotlin.jvm.functions.Function1<? super T,java.lang.Integer> selector)
Returns the sum of all values produced by selector function applied to each element in the collection.
public static <T> double sumByDouble(@NotNull
com.mongodb.client.MongoIterable<T> $this$sumByDouble,
@NotNull
kotlin.jvm.functions.Function1<? super T,java.lang.Double> selector)
Returns the sum of all values produced by selector function applied to each element in the collection.
@SinceKotlin
@NotNull
public static <T> java.util.List<java.util.List> chunked(@NotNull
com.mongodb.client.MongoIterable<T> $this$chunked,
int size)
@SinceKotlin
@NotNull
public static <T,R> java.util.List<R> chunked(@NotNull
com.mongodb.client.MongoIterable<T> $this$chunked,
int size,
@NotNull
kotlin.jvm.functions.Function1<? super java.util.List<? extends T>,? extends R> transform)
Splits this collection into several lists each not exceeding the given size and applies the given transform function to an each.
//Unresolved: samples.text.Strings.chunkedTransform
size - the number of elements to take in each list, must be positive and can be greater than the number of elements in this collection.list of results of the transform applied to an each list.
Note that the list passed to the transform function is ephemeral and is valid only inside that function. You should not store it or allow it to escape in some way, unless you made a snapshot of it. The last list may have less elements than the given size.
@NotNull
public static <T> java.util.List<T> minus(@NotNull
com.mongodb.client.MongoIterable<T> $this$minus,
T element)
Returns a list containing all elements of the original collection without the first occurrence of the given element.
@NotNull
public static <T> java.util.List<T> minus(@NotNull
com.mongodb.client.MongoIterable<T> $this$minus,
@NotNull
T[] elements)
Returns a list containing all elements of the original collection except the elements contained in the given elements array.
@NotNull
public static <T> java.util.List<T> minus(@NotNull
com.mongodb.client.MongoIterable<T> $this$minus,
@NotNull
java.lang.Iterable<? extends T> elements)
Returns a list containing all elements of the original collection except the elements contained in the given elements collection.
@NotNull
public static <T> java.util.List<T> minus(@NotNull
com.mongodb.client.MongoIterable<T> $this$minus,
@NotNull
kotlin.sequences.Sequence<? extends T> elements)
Returns a list containing all elements of the original collection except the elements contained in the given elements sequence.
@NotNull
public static <T> kotlin.Pair<java.util.List,java.util.List> partition(@NotNull
com.mongodb.client.MongoIterable<T> $this$partition,
@NotNull
kotlin.jvm.functions.Function1<? super T,java.lang.Boolean> predicate)
@NotNull
public static <T> java.util.List<T> plus(@NotNull
com.mongodb.client.MongoIterable<T> $this$plus,
T element)
Returns a list containing all elements of the original collection and then the given element.
@NotNull
public static <T> java.util.List<T> plus(@NotNull
com.mongodb.client.MongoIterable<T> $this$plus,
@NotNull
T[] elements)
Returns a list containing all elements of the original collection and then all elements of the given elements array.
@NotNull
public static <T> java.util.List<T> plus(@NotNull
com.mongodb.client.MongoIterable<T> $this$plus,
@NotNull
java.lang.Iterable<? extends T> elements)
Returns a list containing all elements of the original collection and then all elements of the given elements collection.
@NotNull
public static <T> java.util.List<T> plus(@NotNull
com.mongodb.client.MongoIterable<T> $this$plus,
@NotNull
kotlin.sequences.Sequence<? extends T> elements)
Returns a list containing all elements of the original collection and then all elements of the given elements sequence.
@SinceKotlin
@NotNull
public static <T> java.util.List<java.util.List> windowed(@NotNull
com.mongodb.client.MongoIterable<T> $this$windowed,
int size,
int step,
boolean partialWindows)
Returns a list of snapshots of the window of the given size sliding along this collection with the given step, where each snapshot is a list.
Several last lists may have less elements than the given size.
Both size and step must be positive and can be greater than the number of elements in this collection.
//Unresolved: samples.collections.Sequences.Transformations.takeWindows
size - the number of elements to take in each windowstep - the number of elements to move the window forward by on an each step, by default 1partialWindows - controls whether or not to keep partial windows in the end if any,by default false which means partial windows won't be preserved@SinceKotlin
@NotNull
public static <T,R> java.util.List<R> windowed(@NotNull
com.mongodb.client.MongoIterable<T> $this$windowed,
int size,
int step,
boolean partialWindows,
@NotNull
kotlin.jvm.functions.Function1<? super java.util.List<? extends T>,? extends R> transform)
Returns a list of results of applying the given transform function to an each list representing a view over the window of the given size sliding along this collection with the given step.
Note that the list passed to the transform function is ephemeral and is valid only inside that function. You should not store it or allow it to escape in some way, unless you made a snapshot of it. Several last lists may have less elements than the given size.
Both size and step must be positive and can be greater than the number of elements in this collection.
//Unresolved: samples.collections.Sequences.Transformations.averageWindows
size - the number of elements to take in each windowstep - the number of elements to move the window forward by on an each step, by default 1partialWindows - controls whether or not to keep partial windows in the end if any,by default false which means partial windows won't be preserved@NotNull
public static <T,R> java.util.List<kotlin.Pair> zip(@NotNull
com.mongodb.client.MongoIterable<T> $this$zip,
@NotNull
R[] other)
Returns a list of pairs built from the elements of this collection and the other array with the same index.
The returned list has length of the shortest collection.
//Unresolved: samples.collections.Iterables.Operations.zipIterable
@NotNull
public static <T,R,V> java.util.List<V> zip(@NotNull
com.mongodb.client.MongoIterable<T> $this$zip,
@NotNull
R[] other,
@NotNull
kotlin.jvm.functions.Function2<? super T,? super R,? extends V> transform)
Returns a list of values built from the elements of this collection and the other array with the same index
using the provided transform function applied to each pair of elements.
The returned list has length of the shortest collection.
//Unresolved: samples.collections.Iterables.Operations.zipIterableWithTransform
@NotNull
public static <T,R> java.util.List<kotlin.Pair> zip(@NotNull
com.mongodb.client.MongoIterable<T> $this$zip,
@NotNull
java.lang.Iterable<? extends R> other)
Returns a list of pairs built from the elements of this collection and other collection with the same index.
The returned list has length of the shortest collection.
//Unresolved: samples.collections.Iterables.Operations.zipIterable
@NotNull
public static <T,R,V> java.util.List<V> zip(@NotNull
com.mongodb.client.MongoIterable<T> $this$zip,
@NotNull
java.lang.Iterable<? extends R> other,
@NotNull
kotlin.jvm.functions.Function2<? super T,? super R,? extends V> transform)
Returns a list of values built from the elements of this collection and the other collection with the same index
using the provided transform function applied to each pair of elements.
The returned list has length of the shortest collection.
//Unresolved: samples.collections.Iterables.Operations.zipIterableWithTransform
@SinceKotlin
@NotNull
public static <T> java.util.List<kotlin.Pair> zipWithNext(@NotNull
com.mongodb.client.MongoIterable<T> $this$zipWithNext)
Returns a list of pairs of each two adjacent elements in this collection.
The returned list is empty if this collection contains less than two elements.
//Unresolved: samples.collections.Collections.Transformations.zipWithNext
@SinceKotlin
@NotNull
public static <T,R> java.util.List<R> zipWithNext(@NotNull
com.mongodb.client.MongoIterable<T> $this$zipWithNext,
@NotNull
kotlin.jvm.functions.Function2<? super T,? super T,? extends R> transform)
Returns a list containing the results of applying the given transform function to an each pair of two adjacent elements in this collection.
The returned list is empty if this collection contains less than two elements.
//Unresolved: samples.collections.Collections.Transformations.zipWithNextToFindDeltas
@NotNull public static <T,A extends Appendable> A joinTo(@NotNull com.mongodb.client.MongoIterable<T> $this$joinTo, @NotNull A buffer, @NotNull java.lang.CharSequence separator, @NotNull java.lang.CharSequence prefix, @NotNull java.lang.CharSequence postfix, int limit, @NotNull java.lang.CharSequence truncated, @Nullable kotlin.jvm.functions.Function1<? super T,? extends java.lang.CharSequence> transform)
Appends the string from all the elements separated using separator and using the given prefix and postfix if supplied.
If the collection could be huge, you can specify a non-negative value of limit, in which case only the first limit elements will be appended, followed by the truncated string (which defaults to "...").
//Unresolved: samples.collections.Collections.Transformations.joinTo
@NotNull
public static <T> java.lang.String joinToString(@NotNull
com.mongodb.client.MongoIterable<T> $this$joinToString,
@NotNull
java.lang.CharSequence separator,
@NotNull
java.lang.CharSequence prefix,
@NotNull
java.lang.CharSequence postfix,
int limit,
@NotNull
java.lang.CharSequence truncated,
@Nullable
kotlin.jvm.functions.Function1<? super T,? extends java.lang.CharSequence> transform)
Creates a string from all the elements separated using separator and using the given prefix and postfix if supplied.
If the collection could be huge, you can specify a non-negative value of limit, in which case only the first limit elements will be appended, followed by the truncated string (which defaults to "...").
//Unresolved: samples.collections.Collections.Transformations.joinToString
@JvmName
public static double averageOfByte(@NotNull
com.mongodb.client.MongoIterable<java.lang.Byte> $this$average)
Returns an average value of elements in the collection.
@JvmName
public static double averageOfShort(@NotNull
com.mongodb.client.MongoIterable<java.lang.Short> $this$average)
Returns an average value of elements in the collection.
@JvmName
public static double averageOfInt(@NotNull
com.mongodb.client.MongoIterable<java.lang.Integer> $this$average)
Returns an average value of elements in the collection.
@JvmName
public static double averageOfLong(@NotNull
com.mongodb.client.MongoIterable<java.lang.Long> $this$average)
Returns an average value of elements in the collection.
@JvmName
public static double averageOfFloat(@NotNull
com.mongodb.client.MongoIterable<java.lang.Float> $this$average)
Returns an average value of elements in the collection.
@JvmName
public static double averageOfDouble(@NotNull
com.mongodb.client.MongoIterable<java.lang.Double> $this$average)
Returns an average value of elements in the collection.
@JvmName
public static int sumOfByte(@NotNull
com.mongodb.client.MongoIterable<java.lang.Byte> $this$sum)
Returns the sum of all elements in the collection.
@JvmName
public static int sumOfShort(@NotNull
com.mongodb.client.MongoIterable<java.lang.Short> $this$sum)
Returns the sum of all elements in the collection.
@JvmName
public static int sumOfInt(@NotNull
com.mongodb.client.MongoIterable<java.lang.Integer> $this$sum)
Returns the sum of all elements in the collection.
@JvmName
public static long sumOfLong(@NotNull
com.mongodb.client.MongoIterable<java.lang.Long> $this$sum)
Returns the sum of all elements in the collection.
@JvmName
public static float sumOfFloat(@NotNull
com.mongodb.client.MongoIterable<java.lang.Float> $this$sum)
Returns the sum of all elements in the collection.
@JvmName
public static double sumOfDouble(@NotNull
com.mongodb.client.MongoIterable<java.lang.Double> $this$sum)
Returns the sum of all elements in the collection.
@NotNull
public static <T> java.util.List<T> flatten(@NotNull
com.mongodb.client.MongoIterable<java.lang.Iterable> $this$flatten)
Returns a single list of all elements from all collections in the given collection.
//Unresolved: samples.collections.Iterables.Operations.flattenIterable
@NotNull
public static <T,R> kotlin.Pair<java.util.List,java.util.List> unzip(@NotNull
com.mongodb.client.MongoIterable<kotlin.Pair> $this$unzip)
Returns a pair of lists, where first list is built from the first values of each pair from this collection, second list is built from the second values of each pair from this collection.
//Unresolved: samples.collections.Iterables.Operations.unzipIterable
@NotNull
public static <K,V> java.util.Map<K,V> toMap(@NotNull
com.mongodb.client.MongoIterable<kotlin.Pair> $this$toMap)
Returns a new map containing all key-value pairs from the given collection of pairs.
The returned map preserves the entry iteration order of the original collection.
@NotNull public static <K,V,M extends Map<? super K,? super V>> M toMap(@NotNull com.mongodb.client.MongoIterable<kotlin.Pair> $this$toMap, @NotNull M destination)
Populates and returns the destination mutable map with key-value pairs from the given collection of pairs.
@NotNull
public static <R> java.util.List<R> filterIsInstance(@NotNull
com.mongodb.client.MongoIterable<?> $this$filterIsInstance,
@NotNull
java.lang.Class<R> klass)
Returns a list containing all elements that are instances of specified class.
@NotNull public static <C extends Collection<? super R>,R> C filterIsInstanceTo(@NotNull com.mongodb.client.MongoIterable<?> $this$filterIsInstanceTo, @NotNull C destination, @NotNull java.lang.Class<R> klass)
Appends all elements that are instances of specified class to the given destination.
@NotNull public static <T extends Comparable<? super T>> java.util.SortedSet<T> toSortedSet(@NotNull com.mongodb.client.MongoIterable<T> $this$toSortedSet)
Returns a SortedSet of all elements.
@NotNull
public static <T> java.util.SortedSet<T> toSortedSet(@NotNull
com.mongodb.client.MongoIterable<T> $this$toSortedSet,
@NotNull
java.util.Comparator<? super T> comparator)
Returns a SortedSet of all elements.
Elements in the set returned are sorted according to the given comparator.
@SinceKotlin
@NotNull
public static <T> java.util.List<T> shuffled(@NotNull
com.mongodb.client.MongoIterable<T> $this$shuffled)
Returns a new list with the elements of this list randomly shuffled.
@SinceKotlin
@NotNull
public static <T> java.util.List<T> shuffled(@NotNull
com.mongodb.client.MongoIterable<T> $this$shuffled,
@NotNull
java.util.Random random)
Returns a new list with the elements of this list randomly shuffled using the specified random instance as the source of randomness.