ValueWithDefault

data class ValueWithDefault<out T>(explicit: T?, default: T)

A container for a value that can have a default value and can be manually set

Constructors

ValueWithDefault
Link copied to clipboard
common
fun <out T> ValueWithDefault(explicit: T?, default: T)

Properties

default
Link copied to clipboard
common
val default: T
explicit
Link copied to clipboard
common
val explicit: T?
value
Link copied to clipboard
common
val value: T

Extensions

withDefault
Link copied to clipboard
common
fun <T> ValueWithDefault<T>.withDefault(default: T): ValueWithDefault<T>
Create a copy with a new default value
withExplicit
Link copied to clipboard
common
fun <T> ValueWithDefault<T>.withExplicit(explicit: T): ValueWithDefault<T>
Create a copy with a new explicit value