Defaulted

data class Defaulted<T : Defaultable>(val value: T, val default: T? = null)

Holds a value and an optional default value of type T.

Parameters

value

the primary value

default

the default value, if any

Constructors

Link copied to clipboard
constructor(value: T, default: T? = null)

Properties

Link copied to clipboard
val default: T? = null
Link copied to clipboard
val value: T

Functions

Link copied to clipboard
inline fun <T : Defaultable, V> Defaulted<T>.get(valueProvider: T.() -> V?): V?

Retrieves a value using valueProvider from the primary value, or from the default if the primary value is null.