SubInspector

class SubInspector<R, P, T>(parent: Inspector<P>, lens: Lens<P, T>, val rootModelId: RootInspector<R>, val rootLens: Lens<R, T>) : Inspector<T>

SubInspector is the next lower Inspector in a deep nested model structure. It's generated by calling the sub function on an Inspector.

Constructors

Link copied to clipboard
fun <R, P, T> SubInspector(parent: Inspector<P>, lens: Lens<P, T>, rootModelId: RootInspector<R>, rootLens: Lens<R, T>)

Functions

Link copied to clipboard
open override fun <X> sub(lens: Lens<T, X>): SubInspector<R, T, X>

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

Properties

Link copied to clipboard
open override val data: T

returns the underlying data

Link copied to clipboard
open override val path: String

generates the corresponding path

Link copied to clipboard
val rootLens: Lens<R, T>
Link copied to clipboard

Extensions

Link copied to clipboard
inline fun <R, P, T, I> SubInspector<R, P, List<T>>.inspectEach(noinline idProvider: IdProvider<T, I>, action: (SubInspector<R, List<T>, T>) -> Unit)
inline fun <R, P, X> SubInspector<R, P, List<X>>.inspectEach(action: (SubInspector<R, List<X>, X>) -> Unit)

Performs the given action on each SubInspector.

Link copied to clipboard
inline fun <R, P, T, I> SubInspector<R, P, List<T>>.sub(element: T, noinline idProvider: IdProvider<T, I>): SubInspector<R, List<T>, T>
inline fun <R, P, X> SubInspector<R, P, List<X>>.sub(index: Int): SubInspector<R, List<X>, X>

creates a Inspector for an element in your Inspector's list.