All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.com.javiersc.kotlin.stdlib.T.kt Maven / Gradle / Ivy

package com.javiersc.kotlin.stdlib

public inline fun  T?.ifNotNull(block: () -> Unit): T? {
    if (this != null) block()
    return this
}

public inline fun  T?.ifNull(block: () -> Unit): T? {
    if (this == null) block()
    return this
}

public inline infix fun  T?.or(other: T): T = this ?: other

public inline infix fun  T?.or(block: () -> T): T = this ?: block()




© 2015 - 2025 Weber Informatics LLC | Privacy Policy