GenerationSpec

sealed interface GenerationSpec<out T>

Configured generation rule for values of T.

Functions

Link copied to clipboard
abstract infix fun excluding(value: T): GenerationSpec<T>

Excludes value from selection candidates for this generation rule.

abstract infix fun excluding(predicate: (T) -> Boolean): GenerationSpec<T>

Excludes value candidates matching predicate from this generation rule.

abstract infix fun excluding(values: Iterable<T>): GenerationSpec<T>

Excludes values from selection candidates for this generation rule.

Link copied to clipboard
@JvmName(name = "excludingTypePredicate")
infix fun <T> GenerationSpec<T>.excluding(predicate: (KType) -> Boolean): GenerationSpec<T>

Excludes sealed subtype candidates matching predicate from this generation rule.

@JvmName(name = "excludingClasses")
infix fun <T> GenerationSpec<T>.excluding(types: Iterable<KClass<*>>): GenerationSpec<T>

Excludes sealed subtype candidates whose classifier is one of types from this generation rule.

@JvmName(name = "excludingTypes")
infix fun <T> GenerationSpec<T>.excluding(types: Iterable<KType>): GenerationSpec<T>

Excludes sealed subtype candidates matching one of types from this generation rule.

infix fun <T> GenerationSpec<T>.excluding(type: KClass<*>): GenerationSpec<T>

Excludes sealed subtype candidates whose classifier is type from this generation rule.

Excludes sealed subtype candidates matching type from this generation rule.

Link copied to clipboard
abstract infix fun orDefaultAt(probability: Probability): GenerationSpec<T>
open infix fun orDefaultAt(probability: Double): GenerationSpec<T>

Records the probability of using the property's default value.

Link copied to clipboard
abstract infix fun orNullAt(probability: Probability): GenerationSpec<T?>
open infix fun orNullAt(probability: Double): GenerationSpec<T?>

Allows this rule to generate null with probability.

Link copied to clipboard
abstract infix fun withSeed(seed: Long): GenerationSpec<T>

Sets a deterministic seed for this generation rule.