Top Description Methods
jakarta.validation

public Interface ClockProvider

Imports
java.time.Clock

Contract for obtaining the Clock used as the reference for now when validating the @Future and @Past constraints.

The default implementation will return the current system time. Plugging in custom implementations may be useful for instance in batch applications which need to run with a specific logical date, e.g. with yesterday's date when re-running a failed batch job execution.

Implementations must be safe for access from several threads at the same time.

Authors
Gunnar Morling, Guillaume Smet
Since
2.0

Method Summary

Modifier and TypeMethod and Description
public Clock

Returns:

the clock which serves as the reference for now; must not be null
getClock
()

Returns the clock which serves as the reference for now.

Method Detail

getClockback to summary
public Clock getClock()

Returns the clock which serves as the reference for now.

Returns:Clock

the clock which serves as the reference for now; must not be null