api

http4k / org.http4k.lens / BiDiLens

BiDiLens

class BiDiLens<in IN : Any, FINAL> : LensInjector<FINAL, IN>, Lens<IN, FINAL>

A BiDiLens provides the bi-directional extraction of an entity from a target, or the insertion of an entity into a target.

Constructors

Name Summary
<init> A BiDiLens provides the bi-directional extraction of an entity from a target, or the insertion of an entity into a target.BiDiLens(meta: Meta, get: (IN) -> FINAL, lensSet: (FINAL, IN) -> IN)

Functions

Name Summary
invoke Lens operation to set the value into the targetoperator fun <R : IN> invoke(value: FINAL, target: R): R

Extension Functions

Name Summary
asResult Convert the result of a lens extraction to a Result4k type whichfun <IN, OUT> LensExtractor<IN, OUT>.asResult(): LensExtractor<IN, Result<OUT, LensFailure>>
matches Check the content of any lens on a request for routing purposes.fun <T> Lens<Request, T>.matches(fn: (T) -> Boolean): Router