Package net.datafaker.service
Class FakerContext
java.lang.Object
net.datafaker.service.FakerContext
Contains the changeable Faker's part which currently contains
Locale and RandomService.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFakerContext(Locale locale, RandomService randomService) Resolves YAML file using the most specific path first based on language and country code. -
Method Summary
Modifier and TypeMethodDescriptionbooleaninthashCode()protected List<SingletonLocale>protected List<SingletonLocale>localeChain(Locale from) Convert the specified locale into a chain of locales used for message resolution.final voidsetCurrentLocale(Locale locale) voidvoidsetRandomService(RandomService randomService) toString()
-
Field Details
-
DEFAULT_SINGLETON_LOCALE_LIST
-
-
Constructor Details
-
FakerContext
Resolves YAML file using the most specific path first based on language and country code. 'en_US' would resolve in the following order:- /en-US.yml
- /en.yml
Localeinstance. This is legacy behavior and not condoned, but it will work.- EN_US
- En-Us
- eN_uS
-
-
Method Details
-
setLocale
-
setRandomService
-
getLocale
-
getSingletonLocale
-
getRandomService
-
getLocaleChain
-
setCurrentLocale
-
localeChain
Convert the specified locale into a chain of locales used for message resolution. For example:Locale.FRANCE(fr_FR) to [ fr_FR, anotherTest, en ]- Returns:
- a list of
Localeinstances
-
localeChain
-
equals
-
hashCode
public int hashCode() -
toString
-