api

http4k / org.http4k.lens / BiDiMapping

BiDiMapping

class BiDiMapping<IN, OUT> (source)

A BiDiMapping defines a reusable bidirectional transformation between an input and output type

Constructors

Name Summary
<init> BiDiMapping(clazz: Class<OUT>, asOut: (IN) -> OUT, asIn: (OUT) -> IN)
A BiDiMapping defines a reusable bidirectional transformation between an input and output type

Properties

Name Summary
asIn val asIn: (OUT) -> IN
asOut val asOut: (IN) -> OUT
clazz val clazz: Class<OUT>

Functions

Name Summary
invoke operator fun invoke(out: OUT): IN
operator fun invoke(asIn: IN): OUT
map fun <NEXT> map(nextOut: (OUT) -> NEXT, nextIn: (NEXT) -> OUT): BiDiMapping<IN, NEXT>

Companion Object Functions

Name Summary
invoke operator fun <IN, T> invoke(asOut: (IN) -> T, asIn: (T) -> IN): BiDiMapping<IN, T>

Extension Functions

Name Summary
with fun <T> T.with(vararg modifiers: (T) -> T): T