Builder<SecurityTime>public static class SecurityTime.Builder extends java.lang.Object implements Builder<SecurityTime>
SecurityTime.| Modifier and Type | Method | Description |
|---|---|---|
SecurityTime |
build() |
Build the instance from this builder.
|
SecurityTime.Builder |
fromConfig(Config config) |
Update this builder from configuration.
|
SecurityTime.Builder |
shiftBySeconds(long seconds) |
Configure a time-shift in seconds, to move the current time to past or future.
|
SecurityTime.Builder |
timeZone(java.time.ZoneId zoneId) |
Override current time zone.
|
SecurityTime.Builder |
value(java.time.temporal.ChronoField field,
long value) |
Set an explicit value for one of the time fields (such as
ChronoField.YEAR). |
public SecurityTime build()
Builderbuild in interface Builder<SecurityTime>public SecurityTime.Builder timeZone(java.time.ZoneId zoneId)
If we are in a UTC time zone and you set the timezone to "Europe/Prague", the time will be shifted by the offset of Prague (e.g. if it is noon right now in UTC, you would get 14:00).
zoneId - zone id to use for the instance being builtpublic SecurityTime.Builder shiftBySeconds(long seconds)
seconds - number of seconds by which we want to shift the system time, may be negativepublic SecurityTime.Builder value(java.time.temporal.ChronoField field, long value)
ChronoField.YEAR).field - field to setvalue - value to set on the field, see javadoc of each field to see possible valuespublic SecurityTime.Builder fromConfig(Config config)
shiftBySeconds(long)config - configuration to read data fromCopyright © 2018, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.