RootInspector

class RootInspector<T>(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 inspect.

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

Constructors

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

Functions

sub
Link copied to clipboard
common
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

data
Link copied to clipboard
common
open override val data: T
T representation of stored data
path
Link copied to clipboard
common
open override val path: String
String representation of the corresponding path in model

Extensions

inspectEach
Link copied to clipboard
common
inline fun <T, I> RootInspector<List<T>>.inspectEach(noinline idProvider: IdProvider<T, I>, action: (SubInspector<List<T>, List<T>, T>) -> Unit)
Performs the given action on each SubInspector.
inline fun <X> RootInspector<List<X>>.inspectEach(action: (SubInspector<List<X>, List<X>, X>) -> Unit)
Performs the given action on each SubInspector.
sub
Link copied to clipboard
common
inline fun <T, I> RootInspector<List<T>>.sub(element: T, noinline idProvider: IdProvider<T, I>): SubInspector<List<T>, List<T>, T>
creates a Inspector for an element in your Inspector's list.
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.