LensBuilder

interface LensBuilder<IN : Any, OUT>

Common construction patterns for all lens implementations.

Inheritors

Functions

Link copied to clipboard
abstract fun defaulted(name: String, default: OUT, description: String? = null, metadata: Map<String, Any> = emptyMap()): Lens<IN, OUT>

Make a concrete Lens for this spec that falls back to the default value if no value is found in the target.

abstract fun defaulted(name: String, default: LensExtractor<IN, OUT>, description: String? = null, metadata: Map<String, Any> = emptyMap()): Lens<IN, OUT>

Make a concrete Lens for this spec that falls back to another lens if no value is found in the target.

Link copied to clipboard
abstract fun optional(name: String, description: String? = null, metadata: Map<String, Any> = emptyMap()): Lens<IN, OUT?>

Make a concrete Lens for this spec that looks for an optional value in the target.

Link copied to clipboard
abstract fun required(name: String, description: String? = null, metadata: Map<String, Any> = emptyMap()): Lens<IN, OUT>

Make a concrete Lens for this spec that looks for a required value in the target.