Faker

class Faker<T : Any>(clazz: KClass<T>)

Faker implementation. Responsible for generating full objects out of a set of provided Generator instances.

Parameters

clazz

KClass of type T. Used to provide type safety and perform reflective analysis

Constructors

Link copied to clipboard
fun <T : Any> Faker(clazz: KClass<T>)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
inner class CorrelatedPropertyGenerator<R, RR> : Generator<RR>

Functions

Link copied to clipboard
fun generate(seed: Random = Random.Default): T

Generates an instance of T using the Generator instances registered via Faker.invoke

Link copied to clipboard
operator fun <R> KProperty1<T, R>.invoke(init: (KProperty1<T, R>) -> Generator<R>)

Binds a KProperty1 to the specified Generator. Stored by the Faker to be used in each invocation of Faker.generate.