CollectionUtil

@ApiStatus.Internal
class CollectionUtil

Collection util

Types

Link copied to clipboard
Function of float
Link copied to clipboard
Function with index

Functions

Link copied to clipboard
@NotNull
@Unmodifiable
open fun <E, K> associate(@NotNull collection: @NotNull Collection<E>, @NotNull keyMapper: @NotNull (E) -> K): @NotNull @Unmodifiable Map<K, E>
@NotNull
@Unmodifiable
open fun <E, K> associate(@NotNull stream: @NotNull Stream<E>, @NotNull keyMapper: @NotNull (E) -> K): @NotNull @Unmodifiable Map<K, E>
@NotNull
@Unmodifiable
open fun <E, K, V> associate(@NotNull stream: @NotNull Stream<E>, @NotNull keyMapper: @NotNull (E) -> K, @NotNull valueMapper: @NotNull (E) -> V): @NotNull @Unmodifiable Map<K, V>
Associates stream to map
@NotNull
@Unmodifiable
open fun <E, K, V> associate(@NotNull collection: @NotNull Collection<E>, @NotNull keyMapper: @NotNull (E) -> K, @NotNull valueMapper: @NotNull (E) -> V): @NotNull @Unmodifiable Map<K, V>
Associates collection to map
Link copied to clipboard
@NotNull
open fun <E, R> filterIsInstance(@NotNull collection: @NotNull Collection<E>, @NotNull rClass: @NotNull Class<R>): @NotNull Stream<R>
@NotNull
open fun <E, R> filterIsInstance(@NotNull stream: @NotNull Stream<E>, @NotNull rClass: @NotNull Class<R>): @NotNull Stream<R>
Filters stream by some instance
Link copied to clipboard
@NotNull
open fun <T> filterWithWarning(@NotNull predicate: @NotNull Predicate<T>, @NotNull lazyLogFunction: @NotNull (T) -> String): @NotNull Predicate<T>
Gets filter with warning if not matched
Link copied to clipboard
@NotNull
@Unmodifiable
open fun <K, E> group(@NotNull stream: @NotNull Stream<E>, @NotNull keyMapper: @NotNull (E) -> K): @NotNull @Unmodifiable Map<K, List<E>>
Groups stream by some key
Link copied to clipboard
@NotNull
open fun <E, T : FloatCollection?> mapFloat(@NotNull stream: @NotNull Stream<E>, @NotNull mapper: @NotNull CollectionUtil.FloatFunction<E>, @NotNull creator: @NotNull Supplier<T>): @NotNull T
Maps some stream to a float collection
Link copied to clipboard
@NotNull
open fun <E, R> mapIndexed(@NotNull collection: @NotNull Collection<E>, @NotNull function: @NotNull CollectionUtil.IndexedFunction<E, R>): @NotNull Stream<R>
@NotNull
open fun <K, V, R> mapIndexed(@NotNull map: @NotNull Map<K, V>, @NotNull function: @NotNull CollectionUtil.IndexedFunction<Map.Entry<K, V>, R>): @NotNull Stream<R>
@NotNull
open fun <E, R> mapIndexed(@NotNull stream: @NotNull Stream<E>, @NotNull function: @NotNull CollectionUtil.IndexedFunction<E, R>): @NotNull Stream<R>
Maps some collection with map index
Link copied to clipboard
@NotNull
open fun <E, R : JsonElement?> mapToJson(@NotNull collection: @NotNull Collection<E>, @NotNull mapper: @NotNull (E) -> R): @NotNull JsonArray
@NotNull
open fun <E, R : JsonElement?> mapToJson(@NotNull stream: @NotNull Stream<E>, @NotNull mapper: @NotNull (E) -> R): @NotNull JsonArray
@NotNull
open fun <E, R : JsonElement?> mapToJson(capacity: Int, @NotNull stream: @NotNull Stream<E>, @NotNull mapper: @NotNull (E) -> R): @NotNull JsonArray
Maps stream to JSON
Link copied to clipboard
@NotNull
@Unmodifiable
open fun <E, R> mapToList(@NotNull collection: @NotNull Collection<E>, @NotNull mapper: @NotNull (E) -> R): @NotNull @Unmodifiable List<R>
@NotNull
@Unmodifiable
open fun <E, R> mapToList(@NotNull stream: @NotNull Stream<E>, @NotNull mapper: @NotNull (E) -> R): @NotNull @Unmodifiable List<R>
Maps stream to list
Link copied to clipboard
@NotNull
@Unmodifiable
open fun <K, V, R> mapValue(@NotNull original: @NotNull Map<K, V>, @NotNull mapper: @NotNull (V) -> R): @NotNull @Unmodifiable Map<K, R>
Map some map's value.