RootInspector

class RootInspector<T>(val data: T) : Inspector<T>

RootInspector is the starting point for getting your data and corresponding paths from your deep nested model structure. Get this by calling the factory method inspectorOf.

Inspector is useful in validation process to know which model attribute is not valid.

Constructors

Link copied to clipboard
fun <T> RootInspector(data: T)

Functions

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

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

Properties

Link copied to clipboard
open override val data: T

T representation of stored data

Link copied to clipboard
open override val path: String

String representation of the corresponding path in model

Extensions

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

Performs the given action on each SubInspector.

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

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