getOrDefault

fun getOrDefault(defaultValue: T): T

Returns the value if it is present, otherwise returns the specified defaultValue.

Return

the value if present, otherwise defaultValue

Parameters

defaultValue

the value to return if the result is a failure