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

commonMain.com.steamstreet.Nulls.kt Maven / Gradle / Ivy

There is a newer version: 2.0.25
Show newest version
package com.steamstreet

public fun  whenNotNull(a: A?, block: (A) -> T): T? {
    return if (a != null) block(a)
    else null
}

public fun  whenNotNull(a: A?, b: B?, block: (A, B) -> T): T? {
    return if (a != null && b != null) block(a, b)
    else null
}

public fun  whenNotNull(a: A?, b: B?, c: C?, block: (A, B, C) -> T): T? {
    return if (a != null && b != null && c != null) block(a, b, c)
    else null
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy