All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.serpro69.kfaker.FakerConfig.kt Maven / Gradle / Ivy

Go to download

Generate realistically looking fake data such as names, addresses, banking details, and many more, that can be used for testing and data anonymization purposes.

There is a newer version: 2.0.0-rc.7
Show newest version
@file:JvmName("FakerConfigBuilder")

package io.github.serpro69.kfaker

import java.util.*

class FakerConfig private constructor(
    val locale: String,
    val random: Random,
    val uniqueGeneratorRetryLimit: Int
) {

    companion object {
        @JvmStatic
        fun builder() = Builder()
    }

    class Builder internal constructor() {
        var locale = "en"
        var random = Random()
        var uniqueGeneratorRetryLimit = 100

        internal fun build() = FakerConfig(
            locale,
            random,
            uniqueGeneratorRetryLimit
        )
    }
}

fun FakerConfig.Builder.create(block: FakerConfig.Builder.() -> Unit) = this.apply(block).build()




© 2015 - 2025 Weber Informatics LLC | Privacy Policy