public final class TimeUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static long |
timeInMsOrOneIfResultIsZero(long time,
TimeUnit timeUnit)
Convert time to milliseconds based on the given time unit.
|
static long |
timeInMsOrTimeIfNullUnit(long time,
TimeUnit timeUnit)
Convert time to milliseconds based on the given time unit.
|
static long |
zeroOutMs(long timestamp)
Cleans the milliseconds info from the timestamp
|
public static long timeInMsOrOneIfResultIsZero(long time,
TimeUnit timeUnit)
time was > 0, then 1 is returned.time - The input timetimeUnit - The time unit to base the conversion onNullPointerException - if time unit is nullpublic static long timeInMsOrTimeIfNullUnit(long time,
TimeUnit timeUnit)
time - The input timetimeUnit - The time unit to base the conversion onnullpublic static long zeroOutMs(long timestamp)
timestamp - The input timestampCopyright © 2021 Hazelcast, Inc.. All Rights Reserved.