getOrNull

fun <T : Any> Optional<T>.getOrNull(): T?(source)

Returns this Optional's value if present, or otherwise null.

Since Kotlin

1.8