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 input time-unit.
|
static long |
timeInMsOrTimeIfNullUnit(long time,
TimeUnit timeunit)
Convert time to milliseconds based on the input time-unit.
|
static long |
zeroOutMs(long timestamp)
Cleans the milliseconds info from the timestamp
|
public static long timeInMsOrOneIfResultIsZero(long time, TimeUnit timeunit)
time
- The input timetimeunit
- The input time-unit to base the conversion onNullPointerException
- if timeunit is null
public static long timeInMsOrTimeIfNullUnit(long time, TimeUnit timeunit)
time
- The input timetimeunit
- The input time-unit to base the conversion onnull
public static long zeroOutMs(long timestamp)
timestamp
- The input timestampCopyright © 2018 Hazelcast, Inc.. All Rights Reserved.