ObjectTracer

class ObjectTracer(val start: Any, val target: Any)

A utility for determining the shortest path through fields from a starting object to a target object. The search is performed breadth-first to ensure the shortest path is found.

Author

Mark van Gulik

Constructors

Link copied to clipboard
fun ObjectTracer(start: Any, target: Any)

Create the instance, but don't start the search.

Functions

Link copied to clipboard
fun scan(): List<Any>?

Answer the shortest chain of objects starting with start and ending with target. If no such chain was found, answer null.

Properties

Link copied to clipboard
val start: Any

The initial object from which to begin the path search.

Link copied to clipboard
val target: Any

The object to which to find a path, starting at start.