Skip to content
This repository has been archived by the owner on Oct 3, 2022. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
TheFruxz committed Dec 7, 2021
2 parents c17f570 + 0f3890b commit 2779f49
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions JET-JVM/src/main/kotlin/de/jet/jvm/extension/Developer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,12 @@ fun empty() { }
/**
* Returns the [this]<[T]> modified with the [process] if [modifyIf] is true,
*/
fun <T> T?.applyIfNull(process: (T?) -> Unit) = isNull.switchResult(this.apply(process), this)

fun <T> T?.applyIfNotNull(process: (T) -> Unit) = isNotNull.switchResult(this.forceCast<T>().apply(process), this)
fun <T> T?.applyIfNull(process: (T?) -> Unit) = modifyIf(isNull, process)

fun <T> T?.applyIfNotNull(process: (T) -> Unit) = modifyIf(isNotNull) {
process(this!!)
}

fun <T> T?.ifNull(process: () -> Unit) = if (isNull) process() else empty()

Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ plugins {
allprojects {

group = "de.jet"
version = "1.0-BETA-8.1"
version = "1.0-BETA-8.1b"

repositories {
mavenCentral()
Expand Down

0 comments on commit 2779f49

Please sign in to comment.