Lens

interface Lens<P, T>

Describes a focus point into a data structure, i.e. a property of a given complex entity

Functions

apply
Link copied to clipboard
common
open suspend fun apply(parent: P, mapper: suspend (T) -> T): P
manipulates the focus target's value inside the parent
equals
Link copied to clipboard
common
open operator fun equals(other: Any?): Boolean
get
Link copied to clipboard
common
abstract fun get(parent: P): T
gets the value of the focus target
hashCode
Link copied to clipboard
common
open fun hashCode(): Int
plus
Link copied to clipboard
common
open operator fun <X> plus(other: Lens<T, X>): Lens<P, X>
appends to Lenses so that the resulting Lens points from the parent of the Lens this is called on to the target of other
set
Link copied to clipboard
common
abstract fun set(parent: P, value: T): P
sets the value of the focus target
toString
Link copied to clipboard
common
open fun toString(): String

Properties

id
Link copied to clipboard
common
abstract val id: String
identifies the focus of this lens

Extensions

asString
Link copied to clipboard
js
fun <P> Lens<P, Byte>.asString(): Lens<P, String>
Creates a Lens from Byte to String
fun <P> Lens<P, Byte?>.asString(emptyValue: String = ""): Lens<P, String>
Creates a Lens from Byte to String
fun <P> Lens<P, Short>.asString(): Lens<P, String>
Creates a Lens from Short to String
fun <P> Lens<P, Short?>.asString(emptyValue: String = ""): Lens<P, String>
Creates a Lens from Short to String
fun <P> Lens<P, Int>.asString(): Lens<P, String>
Creates a Lens from Int to String
fun <P> Lens<P, Int?>.asString(emptyValue: String = ""): Lens<P, String>
Creates a Lens from Int to String
fun <P> Lens<P, Long>.asString(): Lens<P, String>
Creates a Lens from Long to String
fun <P> Lens<P, Long?>.asString(emptyValue: String = ""): Lens<P, String>
Creates a Lens from Long to String
fun <P> Lens<P, Double>.asString(): Lens<P, String>
Creates a Lens from Double to String
fun <P> Lens<P, Double?>.asString(emptyValue: String = ""): Lens<P, String>
Creates a Lens from Double to String
fun <P> Lens<P, Float>.asString(): Lens<P, String>
Creates a Lens from Float to String
fun <P> Lens<P, Float?>.asString(emptyValue: String = ""): Lens<P, String>
Creates a Lens from Float to String
fun <P> Lens<P, Boolean>.asString(): Lens<P, String>
Creates a Lens from Boolean to String
fun <P> Lens<P, Boolean?>.asString(emptyValue: String = ""): Lens<P, String>
Creates a Lens from Boolean to String
fun <P> Lens<P, List<Byte>>.asString(separator: String = ", ", prefix: String = "", postfix: String = ""): Lens<P, String>
Creates a Lens from List of Byte to String
fun <P> Lens<P, List<Short>>.asString(separator: String = ", ", prefix: String = "", postfix: String = ""): Lens<P, String>
Creates a Lens from List of Short to String
fun <P> Lens<P, List<Int>>.asString(separator: String = ", ", prefix: String = "", postfix: String = ""): Lens<P, String>
Creates a Lens from List of Int to String
fun <P> Lens<P, List<Long>>.asString(separator: String = ", ", prefix: String = "", postfix: String = ""): Lens<P, String>
Creates a Lens from List of Long to String
fun <P> Lens<P, List<Double>>.asString(separator: String = ", ", prefix: String = "", postfix: String = ""): Lens<P, String>
Creates a Lens from List of Double to String
fun <P> Lens<P, List<Float>>.asString(separator: String = ", ", prefix: String = "", postfix: String = ""): Lens<P, String>
Creates a Lens from List of Float to String
fun <P> Lens<P, List<String>>.asString(separator: String = ", ", prefix: String = "", postfix: String = ""): Lens<P, String>
Creates a Lens from List of String to String