ArgumentToNullOrMapperBuilder

class ArgumentToNullOrMapperBuilder<T : Any>(val argumentMapperBuilder: ArgumentMapperBuilder<T?>)(source)

Builder to map variable length arguments formulated as (first: T, vararg others : T) to something else.

Its usage is intended to turn the nullable argument type of the given argumentMapperBuilder into its non-nullable type if the argument is not null in order that the non-nullable type can be used/passed to function which expect a non-nullable type.

Constructors

Link copied to clipboard
constructor(argumentMapperBuilder: ArgumentMapperBuilder<T?>)

Properties

Functions

Link copied to clipboard
inline fun <R : Any> toExpect(crossinline assertionCreator: Expect<R>.(T) -> Unit): Pair<Expect<R>.() -> Unit?, Array<out Expect<R>.() -> Unit?>>

Maps each argument to null if it is already null and if not, then to an Expect<R> lambda with receiver by using the given assertionCreator (passing in the argument).