-
- All Implemented Interfaces:
public final class GlobalUniqueDataDataProvider extends UniqueDataProvider
Global provider for unique values.
This provider is used in Faker class 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<Internet>(listOfValues) // exclude values from `listOfValue` collection from being generated with Internet provider exclude(faker::internet, listOfPatterns) } }
-
-
Method Summary
Modifier and Type Method Description UnitdisableAll()Disables "unique generation" for all providers that were configured to return unique values, and clears out any already returned values, so they can possibly be returned again. UnitclearAll()Clears the already returned (used) unique values and exclusion patterns so that values can again be returned. final <T extends FakeDataProvider> Unitclear(KProperty0<T> providerProperty)final <T extends FakeDataProvider> Unitexclude(String funcName, List<String> values)final <T extends FakeDataProvider> Unitexclude(String funcName, String values)final <T extends FakeDataProvider> Unitenable(KProperty0<T> providerProperty)final <T extends FakeDataProvider> Unitdisable(KProperty0<T> providerProperty)final Unitconfiguration(Function1<UniqueProviderConfiguration, Unit> function)Configures thisUnique provider.-
-
Method Detail
-
disableAll
Unit disableAll()
Disables "unique generation" for all providers that were configured to return unique values, and clears out any already returned values, so they can possibly be returned again.
-
clearAll
Unit clearAll()
Clears the already returned (used) unique values and exclusion patterns so that values can again be returned.
-
clear
final <T extends FakeDataProvider> Unit clear(KProperty0<T> providerProperty)
-
exclude
@Deprecated(level = DeprecationLevel.WARNING, message = "This functionality is deprecated and will be removed in release 1.8.0", replaceWith = @ReplaceWith(imports = {}, expression = "faker.unique.configuration { this.exclude<T>(funcName, values) }")) final <T extends FakeDataProvider> Unit exclude(String funcName, List<String> values)
-
exclude
@Deprecated(level = DeprecationLevel.WARNING, message = "This functionality is deprecated and will be removed in release 1.8.0", replaceWith = @ReplaceWith(imports = {}, expression = "faker.unique.configuration { this.exclude<T>(funcName, values) }")) final <T extends FakeDataProvider> Unit exclude(String funcName, String values)
-
enable
@Deprecated(level = DeprecationLevel.WARNING, message = "This functionality is deprecated and will be removed in release 1.8.0", replaceWith = @ReplaceWith(imports = {}, expression = "faker.unique.configuration { this.enable(providerProperty) }")) final <T extends FakeDataProvider> Unit enable(KProperty0<T> providerProperty)
-
disable
@Deprecated(level = DeprecationLevel.WARNING, message = "This functionality is deprecated and will be removed in release 1.8.0", replaceWith = @ReplaceWith(imports = {}, expression = "faker.unique.configuration { this.disable(providerProperty) }")) final <T extends FakeDataProvider> Unit disable(KProperty0<T> providerProperty)
-
configuration
final Unit configuration(Function1<UniqueProviderConfiguration, Unit> function)
Configures
thisUnique provider.
-
-
-
-