Package io.helidon.security
Class SecurityTime.Builder
- java.lang.Object
-
- io.helidon.security.SecurityTime.Builder
-
- All Implemented Interfaces:
Builder<SecurityTime>
,Supplier<SecurityTime>
- Enclosing class:
- SecurityTime
public static final class SecurityTime.Builder extends Object implements Builder<SecurityTime>
Fluent API builder forSecurityTime
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SecurityTime
build()
Build the instance from this builder.SecurityTime.Builder
config(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(ZoneId zoneId)
Override current time zone.SecurityTime.Builder
value(ChronoField field, long value)
Set an explicit value for one of the time fields (such asChronoField.YEAR
).
-
-
-
Method Detail
-
build
public SecurityTime build()
Description copied from interface:Builder
Build the instance from this builder.- Specified by:
build
in interfaceBuilder<SecurityTime>
- Returns:
- instance of the built type
-
timeZone
public SecurityTime.Builder timeZone(ZoneId zoneId)
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
public SecurityTime.Builder shiftBySeconds(long seconds)
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
public SecurityTime.Builder value(ChronoField field, long 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
public SecurityTime.Builder config(Config 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
-
-