Package dev.enola.common.locale
Class LocaleSupplierTLC
java.lang.Object
dev.enola.common.locale.LocaleSupplierTLC
- All Implemented Interfaces:
LocaleSupplier,Supplier<Locale>
LocaleSupplierTLC is a
LocaleSupplier implementation that looks up the current Locale from the TLC. If it's not found there, then it checks the (static) SINGLETON. Otherwise, it falls back to one passed to the constructor.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final LocaleSupplierFalls back to (variable)Locale.getDefault()if no Locale has been pushed to theTLCnor set on theSINGLETON.static final LocaleSupplierFalls back to (constant)Locale.ROOTif no Locale has been pushed to theTLCnor set on theSINGLETON. -
Constructor Summary
ConstructorsConstructorDescriptionLocaleSupplierTLC(Locale fallbackLocale) Creates a new instance which falls back to the locale passed to this constructor. -
Method Summary
-
Field Details
-
SINGLETON
-
JVM_DEFAULT
Falls back to (variable)Locale.getDefault()if no Locale has been pushed to theTLCnor set on theSINGLETON.Using this in tests could lead to flaky tests which depend on the local OS default.
-
ROOT
Falls back to (constant)Locale.ROOTif no Locale has been pushed to theTLCnor set on theSINGLETON.
-
-
Constructor Details
-
LocaleSupplierTLC
Creates a new instance which falls back to the locale passed to this constructor.
-
-
Method Details