1 /*
2  * Hibernate Validator, declare and validate application constraints
3  *
4  * License: Apache License, Version 2.0
5  * See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
6  */

7 package org.hibernate.validator.internal.engine;
8
9 import java.time.Clock;
10
11 import javax.validation.ClockProvider;
12
13 /**
14  * A default {@link ClockProvider} implementation which returns the current system time in the default time zone using
15  * {@link Clock#systemDefaultZone()}.
16  *
17  * @author Guillaume Smet
18  */

19 public class DefaultClockProvider implements ClockProvider {
20
21     public static final DefaultClockProvider INSTANCE = new DefaultClockProvider();
22
23     private DefaultClockProvider() {
24     }
25
26     @Override
27     public Clock getClock() {
28         return Clock.systemDefaultZone();
29     }
30
31 }
32