mapArguments
Creates a ArgumentMapperBuilder with the given first and others as arguments; specify the mapping as such using a subsequent step in the building process.
For instance (there are more options as second step to choose from):
fun <K, V> pairs(pair: Pair<K, V>, vararg otherPairs: Pair<K, V>) {
mapArguments(pair, otherPairs).toExpect<Map.Entry<K, V>> { isKeyValue(it) }
}
Content copied to clipboard
inline fun <T, R> mapArguments(first: T, others: Array<out T>, mapper: (T) -> R): Pair<R, Array<out R>>(source)
inline fun <R> mapArguments(first: Byte, others: ByteArray, mapper: (Byte) -> R): Pair<R, Array<out R>>(source)
inline fun <R> mapArguments(first: Char, others: CharArray, mapper: (Char) -> R): Pair<R, Array<out R>>(source)
inline fun <R> mapArguments(first: Short, others: ShortArray, mapper: (Short) -> R): Pair<R, Array<out R>>(source)
inline fun <R> mapArguments(first: Int, others: IntArray, mapper: (Int) -> R): Pair<R, Array<out R>>(source)
inline fun <R> mapArguments(first: Long, others: LongArray, mapper: (Long) -> R): Pair<R, Array<out R>>(source)
inline fun <R> mapArguments(first: Float, others: FloatArray, mapper: (Float) -> R): Pair<R, Array<out R>>(source)
inline fun <R> mapArguments(first: Double, others: DoubleArray, mapper: (Double) -> R): Pair<R, Array<out R>>(source)
inline fun <R> mapArguments(first: Boolean, others: BooleanArray, mapper: (Boolean) -> R): Pair<R, Array<out R>>(source)
Maps the given first and others to the given type R with the help of the given mapper.
Use the overload without mapper
in case you want to map to an lambda with an Expect receiver and use one of the available options as second step. For instance, mapArguments(a, aX).toExpect<String> { ... }
Creates a ArgumentMapperBuilder with the given first and others as arguments; specify the mapping as such using a subsequent step in the building process.