stdlib
1.8
1.8
1.7
1.6
1.5
1.4
1.3
1.2
1.1
1.0
JRE8
stdlib
/
kotlin.jvm.optionals
/
getOrDefault
get
Or
Default
JRE8
fun
<
T
>
Optional
<
out
T
&
Any
>
.
getOrDefault
(
defaultValue
:
T
)
:
T
(
source
)
Returns this
Optional
's value if
present
, or otherwise
defaultValue
.
Since Kotlin
1.8