minWith

@JvmName(name = "minWithOrThrow")
fun <T> Array<out T>.minWith(comparator: Comparator<in T>): T(source)
@JvmName(name = "minWithOrThrow")
fun ByteArray.minWith(comparator: Comparator<in Byte>): Byte(source)
@JvmName(name = "minWithOrThrow")
fun ShortArray.minWith(comparator: Comparator<in Short>): Short(source)
@JvmName(name = "minWithOrThrow")
fun IntArray.minWith(comparator: Comparator<in Int>): Int(source)
@JvmName(name = "minWithOrThrow")
fun LongArray.minWith(comparator: Comparator<in Long>): Long(source)
@JvmName(name = "minWithOrThrow")
fun FloatArray.minWith(comparator: Comparator<in Float>): Float(source)
@JvmName(name = "minWithOrThrow")
fun DoubleArray.minWith(comparator: Comparator<in Double>): Double(source)
@JvmName(name = "minWithOrThrow")
fun BooleanArray.minWith(comparator: Comparator<in Boolean>): Boolean(source)
@JvmName(name = "minWithOrThrow")
fun CharArray.minWith(comparator: Comparator<in Char>): Char(source)
@JvmName(name = "minWithOrThrow-U")
fun UIntArray.minWith(comparator: Comparator<in UInt>): UInt(source)
@JvmName(name = "minWithOrThrow-U")
fun ULongArray.minWith(comparator: Comparator<in ULong>): ULong(source)
@JvmName(name = "minWithOrThrow-U")
fun UByteArray.minWith(comparator: Comparator<in UByte>): UByte(source)
@JvmName(name = "minWithOrThrow-U")
fun UShortArray.minWith(comparator: Comparator<in UShort>): UShort(source)

Returns the first element having the smallest value according to the provided comparator.

Since Kotlin

1.7

Throws

if the array is empty.


@JvmName(name = "minWithOrThrow")
fun <T> Iterable<T>.minWith(comparator: Comparator<in T>): T(source)

Returns the first element having the smallest value according to the provided comparator.

Since Kotlin

1.7

Throws

if the collection is empty.


@JvmName(name = "minWithOrThrow")
inline fun <K, V> Map<out K, V>.minWith(comparator: Comparator<in Map.Entry<K, V>>): Map.Entry<K, V>(source)

Returns the first entry having the smallest value according to the provided comparator.

Since Kotlin

1.7

Throws

if the map is empty.

fun <T> Array<out T>.minWith(comparator: Comparator<in T>): T?(source)
fun ByteArray.minWith(comparator: Comparator<in Byte>): Byte?(source)
fun ShortArray.minWith(comparator: Comparator<in Short>): Short?(source)
fun IntArray.minWith(comparator: Comparator<in Int>): Int?(source)
fun LongArray.minWith(comparator: Comparator<in Long>): Long?(source)
fun FloatArray.minWith(comparator: Comparator<in Float>): Float?(source)
fun CharArray.minWith(comparator: Comparator<in Char>): Char?(source)
fun <T> Iterable<T>.minWith(comparator: Comparator<in T>): T?(source)
fun <K, V> Map<out K, V>.minWith(comparator: Comparator<in Map.Entry<K, V>>): Map.Entry<K, V>?(source)

Deprecated

Warning since 1.4

Error since 1.5

Hidden since 1.6

Use minWithOrNull instead.

Replace with

this.minWithOrNull(comparator)

Since Kotlin

1.0

Deprecated

Warning since 1.4

Error since 1.5

Hidden since 1.6

Use minWithOrNull instead.

Replace with

this.minWithOrNull(comparator)

Since Kotlin

1.3