commonMain.com.steamstreet.Nulls.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of awskt-standards-jvm Show documentation
Show all versions of awskt-standards-jvm Show documentation
Standard constructs and functions for working with AWS in Kotlin.
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
}