Interface ProviderRegistration
- All Known Subinterfaces:
BaseProviders
,EntertainmentProviders
,FoodProviders
,HealthcareProviders
,SportProviders
,VideoGameProviders
- All Known Implementing Classes:
BaseFaker
,EntertainmentFaker
,Faker
,FoodFaker
,HealthcareFaker
,SportFaker
,VideoGameFaker
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
Applies both anumerify(String)
and aletterify(String)
over the incoming string.Applies both anumerify(String)
and aletterify(String)
over the incoming string.Returns a string with generated csv based number of lines and column expressions.Returns a string with generated csv based number of lines and column expressions.Generates a String by example.expression
(String expression) <B extends ProviderRegistration>
BgetFaker()
<PR extends ProviderRegistration,
AP extends AbstractProvider<PR>>
APgetProvider
(Class<AP> clazz, Function<PR, AP> valueSupplier) default <PR extends ProviderRegistration,
AP extends AbstractProvider<PR>>
APgetProvider
(String simpleClassName) Returns a string with the '?'Returns a string with the '?'default Options
options()
random()
Generates a String that matches the given regular expression.templatify
(String string, char char2replace, String... options) Returns a string with the char2replace characters in the parameter replaced with random option from available options.templatify
(String string, Map<Character, String[]> optionsMap) Returns a string with the characters in the keys of optionsMap parameter replaced with random option from values.
-
Method Details
-
getFaker
-
getContext
FakerContext getContext() -
getProvider
default <PR extends ProviderRegistration,AP extends AbstractProvider<PR>> AP getProvider(String simpleClassName) -
getProvider
<PR extends ProviderRegistration,AP extends AbstractProvider<PR>> AP getProvider(Class<AP> clazz, Function<PR, AP> valueSupplier) -
resolve
-
resolve
-
numerify
-
letterify
Returns a string with the '?' characters in the parameter replaced with random alphabetic characters.For example, the string "12??34" could be replaced with a string like "12AB34".
- Parameters:
letterString
- Template for string generation- Returns:
- Generated string.
-
letterify
Returns a string with the '?' characters in the parameter replaced with random alphabetic characters.For example, the string "12??34" could be replaced with a string like "12AB34".
-
bothify
Applies both anumerify(String)
and aletterify(String)
over the incoming string. -
bothify
Applies both anumerify(String)
and aletterify(String)
over the incoming string. -
regexify
Generates a String that matches the given regular expression. -
examplify
Generates a String by example. The output string will have the same pattern as the input string.For example: "AAA" becomes "KRA" "abc" becomes "uio" "948" becomes "345" "A19c" becomes "Z20d"
- Parameters:
example
- The input string- Returns:
- The output string based on the input pattern
-
templatify
Returns a string with the char2replace characters in the parameter replaced with random option from available options.For example, the string "ABC??EFG" could be replaced with a string like "ABCtestтестEFG" if passed options are new String[]{"test", "тест"}.
- Parameters:
string
- Template for string generationchar2replace
- Char to replaceoptions
- Options to use while filling the template- Returns:
- Generated string
-
templatify
Returns a string with the characters in the keys of optionsMap parameter replaced with random option from values.For example, the string "ABC$$EFG" could be replaced with a string like "ABCtestтестEFG" if passed for key '$' there is value new String[]{"test", "тест"} in optionsMap
- Parameters:
string
- Template for string generationoptionsMap
- Map with replacement rules- Returns:
- Generated string
-
csv
Returns a string with generated csv based number of lines and column expressions. This method will use comma as default delimiter, always prints header and double quote as default quote.For example, it could generate "name_column","last_name_column" "Sabrina","Kihn"
for expression
faker.expression("#{csv '1','name_column','#{Name.first_name}','last_name_column','#{Name.last_name}'}");
- Parameters:
limit
- Number of linescolumnExpressions
- Even number of expressions. The odd numbers args are used for columns names, and even for column values.- Returns:
- Generated string
-
csv
String csv(String separator, char quote, boolean withHeader, int limit, String... columnExpressions) Returns a string with generated csv based number of lines and column expressions.For example, it could generate "Thad" ### "Crist" "Kathryne" ### "Wuckert" "Sybil" ### "Connelly"
for expression
faker.expression("#{csv ' ### ','"','false','3','name_column','#{Name.first_name}','last_name_column','#{Name.last_name}'}");
- Parameters:
separator
- Delimiter to usequote
- Quote to usewithHeader
- Print header or notlimit
- Number of linescolumnExpressions
- Even number of expressions. The odd numbers args are used for columns names, and even for column values.- Returns:
- Generated string
-
json
-
jsona
-
random
RandomService random() -
expression
-
fakeValuesService
FakeValuesService fakeValuesService() -
options
-
addPath
-
addUrl
-