io.github.serpro69.kfaker.FakerConfig.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kotlin-faker Show documentation
Show all versions of kotlin-faker Show documentation
Generate realistically looking fake data such as names, addresses, banking details, and many more, that can be used for testing and data anonymization purposes.
@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