com.r3corda.core / kotlin.collections.Iterable

Extensions for kotlin.collections.Iterable

isOrderedAndUnique fun <T, I : Comparable<I>> Iterable<T>.isOrderedAndUnique(extractId: T.() -> I): Boolean

Determine if an iterable data types contents are ordered and unique, based on their Comparable.compareTo function.

noneOrSingle fun <T> Iterable<T>.noneOrSingle(predicate: (T) -> Boolean): T?

Returns the single element matching the given predicate, or null if element was not found, or throws if more than one element was found.

fun <T> Iterable<T>.noneOrSingle(): T?

Returns single element, or null if element was not found, or throws if more than one element was found.