Skip to content

1.0.3

Choose a tag to compare

@skydoves skydoves released this 12 Sep 10:44
c6102bd

Released version 1.0.3.

Implemented whatIfNotNullOrEmpty for string type.
We can execute a single lambda if the string is not null and not empty.

val nullableString: String? = "NotNullOrEmpty"
nullableString.whatIfNotNullOrEmpty { 
  log("$it is not null and not empty")
}

Or we can handle the null or empty case.

nullableString.whatIfNotNullOrEmpty(
  whatIf = { nullableString = it },
  whatIfNot = { nullableString = "NullOrEmpty" }
)