Inspector

interface Inspector<D>

represents the data and corresponding id of certain value in a deep nested model structure.

Inheritors

Properties

Link copied to clipboard
abstract val data: D

D representation of stored data

Link copied to clipboard
abstract val path: String

String representation of the corresponding path in model

Functions

Link copied to clipboard
fun <D> Inspector<List<D>>.inspectEach(action: (Inspector<D>) -> Unit)
fun <K, V> Inspector<Map<K, V>>.inspectEach(action: (K, Inspector<V>) -> Unit)
fun <D, I> Inspector<List<D>>.inspectEach(idProvider: IdProvider<D, I>, action: (Inspector<D>) -> Unit)

Performs the given action on each Inspector.

Link copied to clipboard
open fun <X> map(lens: Lens<D, X>): Inspector<X>

creates a new Inspector for a part of your underlying data-model

Link copied to clipboard
fun <D, I> Inspector<List<D>>.mapByElement(element: D, idProvider: IdProvider<D, I>): Inspector<D>

Creates a new Inspector containing the element for the given element and idProvider from the original Inspector's List.

Link copied to clipboard

Creates a new Inspector containing the element for the given index from the original Inspector's List

Link copied to clipboard
fun <K, V> Inspector<Map<K, V>>.mapByKey(key: K): Inspector<V>

Creates a new Inspector containing the value for the given key from the original Inspector's Map

Link copied to clipboard
fun <D> Inspector<D?>.mapNull(default: D): Inspector<D>

Creates a new Inspector from a nullable parent inspector that either contains the original value or a given default value if the original value was null.