Lens

open class Lens<in IN : Any, out FINAL>(val meta: Meta, lensGet: (IN) -> FINAL) : LensExtractor<IN, FINAL> , Iterable<Meta>

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

Inheritors

Constructors

Link copied to clipboard
constructor(meta: Meta, lensGet: (IN) -> FINAL)

Properties

Link copied to clipboard
val meta: Meta

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: IN): FINAL

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

Link copied to clipboard
open fun forEach(p0: Consumer<in Meta>)
Link copied to clipboard
open operator fun <R : IN> 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: IN): FINAL

Lens operation to get the value from the target

Link copied to clipboard
open operator override fun iterator(): Iterator<Meta>
Link copied to clipboard
fun <T> Lens<Request, T>.matches(fn: (T) -> Boolean): Router

Check the content of any lens on a request for routing purposes.

Link copied to clipboard
fun <IN : Any, VALUE : Value<T>, T : Any> Lens<IN, String>.ofOrLensFailure(vf: ValueFactory<VALUE, T>, value: String): VALUE

Convert ot throw a lens failure when constructing a value type

Link copied to clipboard

Restrict the type that this Lens can extract from

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

Convert a synchronous HttpHandler API to mimic AsyncHttpClient