Skip to content

//core/io.github.serpro69.kfaker.provider.misc/RandomProviderConfig

RandomProviderConfig

[jvm]\ class RandomProviderConfig

Configuration for RandomClassProvider.randomClassInstance.

Properties

Name Summary
collectionsSize [jvm]
var collectionsSize: Int
the size of the generated Collection type arguments. Defaults to 1.
constructorFilterStrategy [jvm]
var constructorFilterStrategy: ConstructorFilterStrategy
default strategy for looking up a constructor that is used to create the instance of a class. By default, a zero-args constructor will be used.
constructorParamSize [jvm]
var constructorParamSize: Int
will try to look up the constructor with specified number of arguments, and use that to create the instance of the class. Defaults to -1, which ignores this configuration property. This takes precedence over constructorFilterStrategy configuration.
defaultValuesStrategy [jvm]
var defaultValuesStrategy: DefaultValuesStrategy
strategy for choosing how to handle default constructor parameters' values. By default, generates random values for all constructor parameters.
fallbackStrategy [jvm]
var fallbackStrategy: FallbackStrategy
fallback strategy that is used to look up a constructor if no constructor with constructorParamSize or constructorFilterStrategy was found.

Functions

Name Summary
collectionElementTypeGenerator [jvm]
inline fun <K> collectionElementTypeGenerator(noinline generator: (pInfo: ParameterInfo) -> K?)
Configures generation of elements of constructor parameters of Collection types.
mapEntryKeyTypeGenerator [jvm]
inline fun <K : Any> mapEntryKeyTypeGenerator(noinline generator: (pInfo: ParameterInfo) -> K)
Configures generation of non-null keys of constructor parameters of Map types.
mapEntryValueTypeGenerator [jvm]
inline fun <K> mapEntryValueTypeGenerator(noinline generator: (pInfo: ParameterInfo) -> K?)
Configures generation of values of constructor parameters of Map types.
namedParameterGenerator [jvm]
inline fun <K : Any> namedParameterGenerator(parameterName: String, noinline generator: (pInfo: ParameterInfo) -> K?)
Configures generation for a specific named constructor parameter. Overrides all other generators.
nullableTypeGenerator [jvm]
inline fun <K> nullableTypeGenerator(noinline generator: (pInfo: ParameterInfo) -> K?)
Configures generation for a specific nullable type of constructor parameter. It can override internal generators (for primitives, for example)
typeGenerator [jvm]
inline fun <K : Any> typeGenerator(noinline generator: (pInfo: ParameterInfo) -> K)
Configures generation for a specific type of constructor parameter. It can override internal generators (for primitives, for example)