withDefault

fun <T : Defaultable> T.withDefault(default: T?): Defaulted<T>

Wraps a value with an optional default.

Return

a Defaulted instance containing the value and default

Parameters

default

the default value to associate