BodyLens

open class BodyLens<out FINAL>(val metas: List<Meta>, val contentType: ContentType, getLens: (HttpMessage) -> FINAL) : LensExtractor<HttpMessage, FINAL>

A BodyLens provides the uni-directional extraction of an entity from a target body.

Inheritors

Constructors

Link copied to clipboard
constructor(metas: List<Meta>, contentType: ContentType, getLens: (HttpMessage) -> FINAL)

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun Events.and(next: Events): Events
Link copied to clipboard

Convert the result of a lens extraction to a Result4k type which

Link copied to clipboard
fun (Request) -> Boolean.asRouter(description: String = unavailable.description): Router

Convert any predicate on a request into a router

Link copied to clipboard
Link copied to clipboard
fun HttpHandler.debug(out: PrintStream = System.out, debugStream: Boolean = false): (request: Request) -> Response
Link copied to clipboard
open fun extract(target: HttpMessage): FINAL

Lens operation to get the value from the target. Synonym for invoke(IN)

Link copied to clipboard
open operator fun <R : HttpMessage> get(target: R): FINAL

Lens operation to get the value from the target. Synonym for invoke(IN)

Link copied to clipboard
open operator override fun invoke(target: HttpMessage): FINAL

Lens operation to get the value from the target

Link copied to clipboard

Restrict the type that this Lens can extract from

Link copied to clipboard
fun Events.then(next: Events): (Event) -> Unit
Link copied to clipboard

Convert a synchronous HttpHandler API to mimic AsyncHttpClient