Package dev.enola.common.time
Class ZoneIdSupplierTLC
java.lang.Object
dev.enola.common.time.ZoneIdSupplierTLC
- All Implemented Interfaces:
ZoneIdSupplier,Supplier<ZoneId>
ZoneIdSupplierTLC is a
ZoneIdSupplier implementation that looks up the current TZ 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 ZoneIdSupplierTLCFalls back to (variable)ZoneId.systemDefault()if no TZ has been pushed to theTLCnor set on theSINGLETON.static final ZoneIdSupplierTLCFalls back to (constant)ZoneOffset.UTCif no Locale has been pushed to theTLCnor set on theSINGLETON. -
Constructor Summary
ConstructorsConstructorDescriptionZoneIdSupplierTLC(ZoneId fallback) Creates a new instance which falls back to the TZ passed to this constructor. -
Method Summary
-
Field Details
-
SINGLETON
-
JVM_DEFAULT
Falls back to (variable)ZoneId.systemDefault()if no TZ has been pushed to theTLCnor set on theSINGLETON.Using this in tests could lead to flaky tests which depend on the local OS default.
-
UTC
Falls back to (constant)ZoneOffset.UTCif no Locale has been pushed to theTLCnor set on theSINGLETON.
-
-
Constructor Details
-
ZoneIdSupplierTLC
Creates a new instance which falls back to the TZ passed to this constructor.
-
-
Method Details