package io.github.serpro69.kfaker
Classes
| Name | Description |
|---|---|
abstract class AbstractFaker: Any
|
|
class Faker: AbstractFaker
|
Provides access to 'core' fake data generators. Each category (generator) from this Faker is represented by a property that has the same name as the |
class FakerConfig: Any
|
Configuration for implementations of AbstractFaker. |
class ConfigBuilder
|
Lambda with FakerConfig.Builder receiver type that returns a Unit. Used with DSL functions to construct an instance of FakerConfig by applying the results of the function to the FakerConfig.Builder. |
annotation class FakerDsl: Annotation, Any
|
|
class FakerService: Any
|
Internal class used for resolving yaml expressions into values. |
interface IRandom: Any
|
Provides functionality similar to Random |
class RandomService: IRandom, Any
|
Wrapper around Random that also contains some additional functions not covered by Random. If two instances of this RandomService are created with the same seed, and the same sequence of method calls is made for each, then they will generate and return identical sequences of values. Instances of RandomService are not cryptographically secure by default. Consider passing java.security.SecureRandom to the constructor of this RandomService to get a cryptographically secure pseudo-random generator. |
open class FunctionalUtil: Any
|
Subpackages
| Name | Description |
|---|---|
package io.github.serpro69.kfaker.dictionary
|
|
package io.github.serpro69.kfaker.exception
|
|
package io.github.serpro69.kfaker.extension
|
|
package io.github.serpro69.kfaker.helper
|
|
package io.github.serpro69.kfaker.provider
|
Typealiases
| Name | Description |
|---|---|
typealias ConfigBuilder = Function1
|
Lambda with FakerConfig.Builder receiver type that returns a Unit. Used with DSL functions to construct an instance of FakerConfig by applying the results of the function to the FakerConfig.Builder. |
Methods
faker
fun faker(block: Builder.()->Unit): Faker
Parameters
| Name | Description |
|---|---|
block: Builder.()->Unit
|
ReturnValue
| Name | Description |
|---|---|
Faker
|
fakerConfig
fun fakerConfig(block: ConfigBuilder): FakerConfig
Applies the the block function to ConfigBuilder and returns as an instance of FakerConfig from that builder.
Parameters
| Name | Description |
|---|---|
block: ConfigBuilder
|
ReturnValue
| Name | Description |
|---|---|
FakerConfig
|
randomClassInstance
inline fun <T : Any> randomClassInstance(configurator: RandomProviderConfig.()->Unit): T
Creates an instance of T. If T has a parameterless public/internal 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
| Name | Description |
|---|---|
configurator: RandomProviderConfig.()->Unit
|
configure random class instance creation |
ReturnValue
| Name | Description |
|---|---|
T
|
randomClassInstance
fun <T : Any> randomClassInstance(fakerConfig: FakerConfig): T
Creates an instance of T. If T has a parameterless public/internal 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
| Name | Description |
|---|---|
fakerConfig: FakerConfig
|
configure RandomClassProvider via the FakerConfig |
ReturnValue
| Name | Description |
|---|---|
T
|
randomClassInstance
fun <T : Any> randomClassInstance(kClass: KClass<T>, configurator: RandomProviderConfig.()->Unit): T
Creates an instance of T from the KClass input. If T has a parameterless public/internal 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
| Name | Description |
|---|---|
kClass: KClass<T>
|
a KClass of T |
configurator: RandomProviderConfig.()->Unit
|
configure random class instance creation |
ReturnValue
| Name | Description |
|---|---|
T
|
randomClassInstance
fun <T : Any> randomClassInstance(kClass: KClass<T>, fakerConfig: FakerConfig): T
Creates an instance of T from the KClass input. If T has a parameterless public/internal 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
| Name | Description |
|---|---|
kClass: KClass<T>
|
a KClass of T |
fakerConfig: FakerConfig
|
configure RandomClassProvider via the FakerConfig |
ReturnValue
| Name | Description |
|---|---|
T
|
Applies the block function to Faker.Builder and returns as an instance of Faker from that builder.