public abstract class DbClockUtils extends Object
ITickClock,
TickClock| 构造器和说明 |
|---|
DbClockUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static long |
currentTimeMicros()
主要数据源的当前微秒数
|
static long |
currentTimeMicros(DataSource dataSource)
主要数据源当前微秒数
|
static long |
currentTimeMillis()
主要数据源的当前毫秒数
|
static long |
currentTimeMillis(DataSource dataSource)
主要数据源当前毫秒数
|
static long |
currentTimeNanos()
主要数据源的当前纳秒数
注意:值格式与 System.nanoTime() 并不相同 |
static long |
currentTimeNanos(DataSource dataSource)
主要数据源当前纳秒数
注意:值格式与 System.nanoTime() 并不相同 |
static ITickClock |
getClock()
获取主要数据库时钟
|
static ITickClock |
getClock(DataSource dataSource)
获取数据库时钟
|
static DataSource |
getPrimaryDataSource()
获取主要数据源
|
static Date |
now()
主要数据源的当前时间
|
static Date |
now(DataSource dataSource)
数据源的当前时间
|
static ITickClock |
refreshClock()
刷新数据库时钟并返回新时钟
|
static ITickClock |
refreshClock(DataSource dataSource)
刷新数据库时钟并返回新时钟
|
static ITickClock |
setPrimaryDataSource(DataSource primaryDataSource)
设置主要数据源及其时钟
|
@NonNull public static ITickClock getClock(DataSource dataSource)
dataSource - 数据源@NonNull public static ITickClock refreshClock(DataSource dataSource)
dataSource - 数据源@NonNull public static Date now(DataSource dataSource)
dataSource - 数据源public static long currentTimeMillis(DataSource dataSource)
dataSource - 数据源public static long currentTimeMicros(DataSource dataSource)
dataSource - 数据源public static long currentTimeNanos(DataSource dataSource)
System.nanoTime() 并不相同dataSource - 数据源@Nullable public static DataSource getPrimaryDataSource()
public static ITickClock setPrimaryDataSource(DataSource primaryDataSource)
primaryDataSource - 主要数据源@Nullable public static ITickClock getClock()
@NonNull public static ITickClock refreshClock()
RuntimeException - 当primaryDataSource从未设置过时,会抛出该异常public static Date now()
NullPointerException - 如果`primaryClock`为空,将抛出该异常public static long currentTimeMillis()
NullPointerException - 如果`primaryClock`为空,将抛出该异常public static long currentTimeMicros()
NullPointerException - 如果`primaryClock`为空,将抛出该异常public static long currentTimeNanos()
System.nanoTime() 并不相同NullPointerException - 如果`primaryClock`为空,将抛出该异常Copyright © 2021 EasyJ寮�婧愮ぞ鍖�. All rights reserved.