public class TimeZoneHolder extends Object
ZoneId.systemDefault().| Modifier and Type | Class and Description |
|---|---|
static interface |
TimeZoneHolder.TypedCallable<V,E extends Exception> |
| Constructor and Description |
|---|
TimeZoneHolder() |
| Modifier and Type | Method and Description |
|---|---|
static ZoneId |
getZone() |
static ZoneId |
setZone(ZoneId zone)
Set the current context time zone for this thread.
|
static <V,E extends Exception> |
withZone(ZoneId zone,
TimeZoneHolder.TypedCallable<V,E> task)
Call a
TimeZoneHolder.TypedCallable with a given timezone. |
public static ZoneId getZone()
public static ZoneId setZone(ZoneId zone)
public static <V,E extends Exception> V withZone(ZoneId zone, TimeZoneHolder.TypedCallable<V,E> task) throws E extends Exception
TimeZoneHolder.TypedCallable with a given timezone. The timezone will be reset after the callable
has completed.E extends ExceptionCopyright © 2019. All rights reserved.