intellij-randomness / com.fwdekker.randomness / firstNonNull

firstNonNull

fun <T : Any> firstNonNull(vararg values: T?): T?

Returns the first non-null value in values, or null if all values are null.

Parameters

T - the type of elements to check for nullness

values - the values to check for nullness

Return
the first non-null value in values, or null if all values are null.