Package-level declarations

Contains inter alia the mapArgument function next to other helper functions such as nullable and co.

Types

Link copied to clipboard

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

Link copied to clipboard
class ArgumentToNullOrMapperBuilder<T : Any>(val argumentMapperBuilder: ArgumentMapperBuilder<T?>)

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

Link copied to clipboard
interface Group<out T>

Represents a group of T.

Link copied to clipboard
interface VarArgHelper<out T>

Represents a parameter object used to express the arguments T, vararg T and provides utility functions to transform them.

Functions

Link copied to clipboard
inline fun <T> expectLambda(noinline assertionCreator: Expect<T>.() -> Unit): Expect<T>.() -> Unit

Can be used in places where a lambda with receiver is required where the receiver is of type Expect<T>.

Link copied to clipboard
fun <T> groupsToList(firstGroup: Group<T>, secondGroup: Group<T>, otherGroups: Array<out Group<T>>): List<List<T>>

Adds the given firstGroup, the secondGroup and the otherGroups into a new List and returns it.

Link copied to clipboard

Transforms the given iterableLike to an Iterable with an element type T.

Transforms the given iterableLike to an Iterable with an element type T.

Link copied to clipboard
fun <T> mapArguments(first: T, others: Array<out T>): ArgumentMapperBuilder<T>

Creates a ArgumentMapperBuilder with the given first and others as arguments; specify the mapping as such using a subsequent step in the building process.

inline fun <T, R> mapArguments(first: T, others: Array<out T>, mapper: (T) -> R): Pair<R, Array<out R>>
inline fun <R> mapArguments(first: Boolean, others: BooleanArray, mapper: (Boolean) -> R): Pair<R, Array<out R>>
inline fun <R> mapArguments(first: Byte, others: ByteArray, mapper: (Byte) -> R): Pair<R, Array<out R>>
inline fun <R> mapArguments(first: Char, others: CharArray, mapper: (Char) -> R): Pair<R, Array<out R>>
inline fun <R> mapArguments(first: Double, others: DoubleArray, mapper: (Double) -> R): Pair<R, Array<out R>>
inline fun <R> mapArguments(first: Float, others: FloatArray, mapper: (Float) -> R): Pair<R, Array<out R>>
inline fun <R> mapArguments(first: Int, others: IntArray, mapper: (Int) -> R): Pair<R, Array<out R>>
inline fun <R> mapArguments(first: Long, others: LongArray, mapper: (Long) -> R): Pair<R, Array<out R>>
inline fun <R> mapArguments(first: Short, others: ShortArray, mapper: (Short) -> R): Pair<R, Array<out R>>

Maps the given first and others to the given type R with the help of the given mapper.

Link copied to clipboard

Transforms the given MapLike to Pair<Pair<K, V>, Array<out Pair<K, V>>> with the intention that it can be easily used for a function requiring Pair<K, V>, vararg Pair<K, V>.

Link copied to clipboard

Transforms the given MapLike to an Iterable with an element type Pair<K, V>.

Link copied to clipboard
inline fun <T> nullable(t: T): T?

Turns the given type into a nullable type.

inline fun <T> nullable(t: () -> T): () -> T?
@JvmName(name = "nullable1")
inline fun <T1, R> nullable(t: (T1) -> R): (T1) -> R?
@JvmName(name = "nullable2")
inline fun <T1, T2, R> nullable(t: (T1, T2) -> R): (T1, T2) -> R?
@JvmName(name = "nullable3")
inline fun <T1, T2, T3, R> nullable(t: (T1, T2, T3) -> R): (T1, T2, T3) -> R?
@JvmName(name = "nullable4")
inline fun <T1, T2, T3, T4, R> nullable(t: (T1, T2, T3, T4) -> R): (T1, T2, T3, T4) -> R?
@JvmName(name = "nullable5")
inline fun <T1, T2, T3, T4, T5, R> nullable(t: (T1, T2, T3, T4, T5) -> R): (T1, T2, T3, T4, T5) -> R?

Turns the given function reference into a function reference with a nullable return type.

Link copied to clipboard
inline fun <T> nullableContainer(arr: Array<out T>): Array<out T?>

Turns an Array into an array with a nullable element type.

inline fun <T> nullableContainer(iterable: Iterable<T>): Iterable<T?>

Turns an Iterable into an iterable with a nullable element type.

Link copied to clipboard
inline fun <K, V : Any> nullableKeyMap(map: Map<out K, V>): Map<out K?, V>

Turns a Map into a map with a nullable key type.

Link copied to clipboard
inline fun <K, V> nullableKeyValueMap(map: Map<out K, V>): Map<out K?, V?>

Turns a Map into a map with a nullable key and a nullable value type.

Link copied to clipboard
inline fun <K : Any, V> nullableValueMap(map: Map<K, V>): Map<K, V?>

Turns a Map into a map with a nullable value type.

Link copied to clipboard

Maps each argument to null if it is already null and if not, then ...

Link copied to clipboard
inline fun <T> CharSequenceContains.CheckerStepLogic<*, *>.toVarArg(iterableLike: IterableLike): Pair<T, Array<out T>>
inline fun <T> CharSequenceContains.EntryPointStepLogic<*, *>.toVarArg(iterableLike: IterableLike): Pair<T, Array<out T>>
inline fun <T> IterableLikeContains.CheckerStepLogic<*, *, *>.toVarArg(iterableLike: IterableLike): Pair<T, Array<out T>>
inline fun <T> IterableLikeContains.EntryPointStepLogic<*, *, *>.toVarArg(iterableLike: IterableLike): Pair<T, Array<out T>>

Transforms the given iterableLike to Pair<T, Array<out T>> with the intention that it can be easily used for a function requiring T, vararg T.

Link copied to clipboard
fun <K, V> MapLikeContains.EntryPointStepLogic<*, *, *, *>.toVarArgPairs(mapLike: MapLike): Pair<Pair<K, V>, Array<out Pair<K, V>>>

Transforms the given MapLike to Pair<Pair<K, V>, Array<out Pair<K, V>>> with the intention that it can be easily used for a function requiring Pair<K, V>, vararg Pair<K, V>.