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 .yml file.

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

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

Applies the block function to Faker.Builder and returns as an instance of Faker from that builder.

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