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 null
public static long timeInMsOrTimeIfNullUnit(long time, TimeUnit timeUnit)
time
- The input timetimeUnit
- The time unit to base the conversion onnull
public static long zeroOutMs(long timestamp)
timestamp
- The input timestampCopyright © 2019 Hazelcast, Inc.. All Rights Reserved.