Class FakerContext

java.lang.Object
net.datafaker.service.FakerContext

public class FakerContext extends Object
Contains the changeable Faker's part which currently contains Locale and RandomService.
  • Field Details

    • DEFAULT_SINGLETON_LOCALE_LIST

      public static final List<SingletonLocale> DEFAULT_SINGLETON_LOCALE_LIST
  • Constructor Details

    • FakerContext

      public FakerContext(Locale locale, RandomService randomService)
      Resolves YAML file using the most specific path first based on language and country code. 'en_US' would resolve in the following order:
      1. /en-US.yml
      2. /en.yml
      The search is case-insensitive, so the following will all resolve correctly. Also, either a hyphen or an underscore can be used when constructing a Locale instance. This is legacy behavior and not condoned, but it will work.
      • EN_US
      • En-Us
      • eN_uS
  • Method Details