@Service class DefaultBusinessTime extends Object implements BusinessTime
BusinessTime to record Durations to calculate the current business time
by accumulating them.| Constructor and Description |
|---|
DefaultBusinessTime() |
| Modifier and Type | Method and Description |
|---|---|
void |
forward(Duration duration)
Forwards the current time with the given
Duration. |
Duration |
getOffset()
Returns the current offset between the real time and the virtual one created by calling
BusinessTime.forward(Duration). |
LocalDateTime |
getTime()
Returns the current business time.
|
void |
reset()
Undoes any forwarding.
|
public LocalDateTime getTime()
BusinessTimeBusinessTime.forward(Duration).getTime in interface BusinessTimepublic void forward(Duration duration)
BusinessTimeDuration. Calling the method multiple times will accumulate
durations.forward in interface BusinessTimepublic Duration getOffset()
BusinessTimeBusinessTime.forward(Duration).getOffset in interface BusinessTimepublic void reset()
BusinessTimeBusinessTime.getTime() will be equivalent to the system's time again.reset in interface BusinessTimeCopyright © 2018 Pivotal Software, Inc.. All rights reserved.