Package dev.fritz2.identification

Types

Id
Link copied to clipboard
common
object Id
Inspector
Link copied to clipboard
common
interface Inspector<T>
represents the data and corresponding id of certain value in a deep nested model structure.
RootInspector
Link copied to clipboard
common
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.
SubInspector
Link copied to clipboard
common
class SubInspector<R, P, T>(parent: Inspector<P>, lens: Lens<P, T>, rootModelId: RootInspector<R>, rootLens: Lens<R, T>) : Inspector<T>
SubInspector is the next lower Inspector in a deep nested model structure.

Functions

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