@@ -197,24 +197,35 @@ class Faker @JvmOverloads constructor(internal val config: FakerConfig = fakerCo
197
197
val zelda: Zelda = Zelda (fakerService)
198
198
199
199
@FakerDsl
200
+ /* *
201
+ * DSL builder for creating instances of [Faker]
202
+ */
200
203
class Builder internal constructor(){
201
- private var config = io.github.serpro69.kfaker.fakerConfig { }
204
+ /* *
205
+ * @property config faker configuration for the [Faker] instance
206
+ * which will be created with this [Faker.Builder].
207
+ */
208
+ private var config: FakerConfig = io.github.serpro69.kfaker.fakerConfig { }
202
209
203
- @Deprecated(
204
- message = " This API is unstable and might change in the final 1.8.0 release." ,
205
- level = DeprecationLevel .WARNING ,
206
- replaceWith = ReplaceWith (expression = " fakerConfig{ }" )
207
- )
208
- fun config (block : FakerConfig .Builder .() -> Unit ) {
210
+ /* *
211
+ * Sets [config] configuration for this [Faker.Builder]
212
+ * using the results of the [block] function.
213
+ *
214
+ * This [config] will then be used when an instance of [Faker] is created using this [Faker.Builder]
215
+ */
216
+ fun fakerConfig (block : ConfigBuilder ) {
209
217
config = io.github.serpro69.kfaker.fakerConfig(block)
210
218
}
211
219
212
- fun fakerConfig (block : FakerConfig .Builder .() -> Unit ) {
213
- config = io.github.serpro69.kfaker.fakerConfig(block)
214
- }
215
-
216
- internal fun build () = Faker (config)
220
+ /* *
221
+ * Builds an instance of [Faker] with this [config].
222
+ */
223
+ internal fun build (): Faker = Faker (config)
217
224
}
218
225
}
219
226
220
- fun faker (block : Faker .Builder .() -> Unit ) = Faker .Builder ().apply (block).build()
227
+ /* *
228
+ * Applies the the [block] function to [Faker.Builder]
229
+ * and returns as an instance of [Faker] from that builder.
230
+ */
231
+ fun faker (block : Faker .Builder .() -> Unit ): Faker = Faker .Builder ().apply (block).build()
0 commit comments