-
- All Implemented Interfaces:
public final class RandomProviderProvider for functionality not covered by the standard dictionary files.
Inspired by Creating a random instance of any class in Kotlin blog post.
-
-
Method Summary
Modifier and Type Method Description final <T extends Any> TrandomClassInstance()Creates an instance of T. final <T extends Any> TrandomClassInstance(Function1<RandomProviderConfig, Unit> configurator)Creates an instance of T. -
-
Method Detail
-
randomClassInstance
final <T extends Any> T randomClassInstance()
-
randomClassInstance
final <T extends Any> T randomClassInstance(Function1<RandomProviderConfig, Unit> configurator)
Creates an instance of T. If T has a parameterless public constructor then it will be used to create an instance of this class, otherwise a constructor with minimal number of parameters will be used with randomly-generated values.
- Parameters:
configurator- configure instance creation.
-
-
-
-