Package-level declarations

Functions

Link copied to clipboard
inline fun <T : MutableCollection<A>, A> T.clearThenAddAllNotNull(transform: (A) -> A?): T

Removes all elements in a collection and transforms them, leaving out any that are transformed to null.

Link copied to clipboard
inline fun <T : MutableCollection<A>, A> T.mutateAll(transform: (A) -> A): T

Applies transform to each element in the collection, reusing the same structure to keep them.

Link copied to clipboard
inline fun <T : MutableCollection<A>, A> T.mutateAllIndexed(transform: (index: Int, value: A) -> A): T

Applies transform to each element in the collection with the current item index, reusing the same structure to keep them.

Link copied to clipboard
inline fun <T : MutableCollection<A>, A> T.mutateAllIndexedNotNull(transform: (index: Int, value: A) -> A?): T

Applies transform to each element in the list with the current item index, removing the value if null is returned.

Link copied to clipboard
inline fun <T : MutableCollection<A>, A> T.mutateAllNotNull(transform: (A) -> A?): T

Applies transform to each element in the collection, removing the item if null is returned.

inline fun <A> MutableList<A>.mutateAllNotNull(transform: (A) -> A?): MutableList<A>

Applies transform to each element in the list, removing the item if null is returned.

Link copied to clipboard
inline fun <K, V> MutableMap<K, V>.mutateValues(transform: (entry: Map.Entry<K, V>) -> V): MutableMap<K, V>
inline fun <K, V> MutableMap<K, V>.mutateValues(transform: (key: K, value: V) -> V): MutableMap<K, V>

Applies transform to each entry in the map, reusing the same structure to keep them.

Link copied to clipboard
inline fun <K, V> MutableMap<K, V>.mutateValuesNotNull(transform: (entry: Map.Entry<K, V>) -> V?): MutableMap<K, V>
inline fun <K, V> MutableMap<K, V>.mutateValuesNotNull(transform: (key: K, value: V) -> V?): MutableMap<K, V>

Applies transform to each entry in the map, removing the item if null is returned.

Link copied to clipboard

Removes any items in the list that are not type A and returns a MutableCollection<A> with the remaining items.

Removes any items in the list that are not type A and returns a MutableList<A> with the remaining items.

Removes any items in the list that are not type A and returns a MutableSet<A> with the remaining items.

Link copied to clipboard

Removes any values in the map that are not type V and returns a MutableMap<K, V> with the remaining entries.