resolveNull

fun <T> T?.resolveNull(ifNotNull: T, ifNull: T): T

Resolves the nullable receiver to a non-null value.

Return

ifNotNull if the receiver is not null, otherwise ifNull.

Parameters

ifNotNull

The value to return if the receiver is not null.

ifNull

The value to return if the receiver is null.