map

fun <IN, OUT> TransactionValue<IN>.map(transformation: (IN) -> OUT): TransactionValue<OUT>

Applies transformation to this value once it resolves.

The step that uses the result gets what the function returned, so a row can become the one column of it the next step needs and a list can become its size, without a step added to compute it. The function's parameter has the type the producing step's terminal declared:

"edict_id" to edict.value().map { it.get<Int>("id") }

Anything the function throws arrives as a MappingException naming the step, the parameter and which map of the chain it was, with what was thrown as its cause. An OctaviusException is passed through as it was thrown - restating one would cost the type the caller catches on - and picks up the same three on its path instead, which is the breadcrumb every layer leaves and the only thing that can be added to an exception without replacing it.

Return

The transformed value, still unresolved.

Parameters

transformation

What to do to the resolved value.