java.lang.Object
io.helidon.security.SecurityTime.Builder
- All Implemented Interfaces:
Builder<SecurityTime.Builder,
,SecurityTime> Supplier<SecurityTime>
- Enclosing class:
SecurityTime
public static final class SecurityTime.Builder
extends Object
implements Builder<SecurityTime.Builder,SecurityTime>
Fluent API builder for
SecurityTime
.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build the instance from this builder.Update this builder from configuration.shiftBySeconds
(long seconds) Configure a time-shift in seconds, to move the current time to past or future.Override current time zone.value
(ChronoField field, long value) Set an explicit value for one of the time fields (such asChronoField.YEAR
).
-
Method Details
-
build
Description copied from interface:Builder
Build the instance from this builder.- Specified by:
build
in interfaceBuilder<SecurityTime.Builder,
SecurityTime> - Returns:
- instance of the built type
-
timeZone
Override current time zone. The time will represent the SAME instant, in an explicit timezone.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).
- Parameters:
zoneId
- zone id to use for the instance being built- Returns:
- updated builder instance
-
shiftBySeconds
Configure a time-shift in seconds, to move the current time to past or future.- Parameters:
seconds
- number of seconds by which we want to shift the system time, may be negative- Returns:
- updated builder instance
-
value
Set an explicit value for one of the time fields (such asChronoField.YEAR
).- Parameters:
field
- field to setvalue
- value to set on the field, see javadoc of each field to see possible values- Returns:
- updated builder instance
-
config
Update this builder from configuration. The config should be located on parent key of the following keys (all of them are optional):- time-zone: set time zone id (such as Europe/Prague) of desired time zone
- shift-by-seconds:
shiftBySeconds(long)
- year: set an explicit year value
- month: set an explicit month value (1-12)
- day-of-month: set an explicit day of month value (1-31)
- hour-of-day: set an explicit hour of day value (0-23)
- minute: set an explicit minute value (0-59)
- second: set an explicit second value (0-59)
- millisecond: set an explicit millisecond value (0-999)
- Parameters:
config
- configuration to read data from- Returns:
- updated builder instance
-