class ConstructorCodeGenerator<T : Any>
This utility is used to generate the code need to construct an object. It is useful for printing out a MavericksState instance's constructor code when setting up a test for that state.
It uses recursion to analyze the given object instance and generates code needed to construct another instance of the object containing the same data.
data class EnclosingClass |
ConstructorCodeGenerator(objectToCopy: T, listTruncationThreshold: Int = 300, stringTruncationThreshold: Int = 3, customTypePrinters: List<TypePrinter<*>> = emptyList())
This utility is used to generate the code need to construct an object. It is useful for printing out a MavericksState instance's constructor code when setting up a test for that state. |
val constructorCode: String
The code needed to reconstruct objectToCopy. |
|
val imports: List<String>
The fully qualified names of all classes and functions that are used in the code. |
|
val lazyPropertyToCreateObject: String
Wraps constructorCode in a property that is lazily initialized. |