package io.github.serpro69.kfaker.provider.unique

Classes

Name Description
class GlobalUniqueDataProvider: UniqueDataProvider

Global provider for unique values.

This provider is used in AbstractFaker class implementations to control global unique generation configuration of faker providers.

Example usage:


val faker = Faker()
faker.unique.configuration {
    enable(faker::address) // enables unique generation for all functions of Address provider
    enable(faker::name) // enables unique generation for all functions of Name provider
    exclude(listOfValues) // exclude values from `listOfValue` collection from being generated (for all providers that are enabled for unique generation)
    enable(faker::internet) { enables unique generation for all functions of Internet provider
        exclude(listOfValues) // exclude values from `listOfValue` collection from being generated with Internet provider
        exclude(faker::internet, listOfPatterns)
    }
}
class LocalUniqueDataProvider<T : FakeDataProvider> : UniqueDataProvider

Local provider for unique values.

This provider is used in T implementation of FakeDataProvider class, and controls unique generation configuration of T's functions.

Example usage:


Faker().address.unique().country()
class UniqueProviderDelegate<T : AbstractFakeDataProvider<*>> : Any

Delegate class for LocalUniqueDataProvider used to return local providers that generate unique values.

abstract class UniqueDataProvider: Any
class UniqueProviderConfiguration: Any

Provides configuration for Unique Generation of values.