Package uk.gov.gchq.gaffer.time
Class CommonTimeUtil
- java.lang.Object
-
- uk.gov.gchq.gaffer.time.CommonTimeUtil
-
public final class CommonTimeUtil extends Object
Utility methods for dates and times.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CommonTimeUtil.TimeBucket
Type representing a "bucket" of time.
-
Field Summary
Fields Modifier and Type Field Description static long
MILLISECONDS_IN_DAY
static long
MILLISECONDS_IN_HOUR
static long
MILLISECONDS_IN_MINUTE
static long
MILLISECONDS_IN_SECOND
static long
MILLISECONDS_IN_WEEK
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static long
timeToBucket(long time, CommonTimeUtil.TimeBucket bucket)
Place a time value (a JavaLong
representing the number of milliseconds since the start of the Unix epoch) in aCommonTimeUtil.TimeBucket
.static long
timeToBucketEnd(long time, CommonTimeUtil.TimeBucket bucket)
static long
timeToBucketStart(long time, CommonTimeUtil.TimeBucket bucket)
-
-
-
Field Detail
-
MILLISECONDS_IN_SECOND
public static final long MILLISECONDS_IN_SECOND
- See Also:
- Constant Field Values
-
MILLISECONDS_IN_MINUTE
public static final long MILLISECONDS_IN_MINUTE
- See Also:
- Constant Field Values
-
MILLISECONDS_IN_HOUR
public static final long MILLISECONDS_IN_HOUR
- See Also:
- Constant Field Values
-
MILLISECONDS_IN_DAY
public static final long MILLISECONDS_IN_DAY
- See Also:
- Constant Field Values
-
MILLISECONDS_IN_WEEK
public static final long MILLISECONDS_IN_WEEK
- See Also:
- Constant Field Values
-
-
Method Detail
-
timeToBucket
public static long timeToBucket(long time, CommonTimeUtil.TimeBucket bucket)
Place a time value (a JavaLong
representing the number of milliseconds since the start of the Unix epoch) in aCommonTimeUtil.TimeBucket
.- Parameters:
time
- the time, in milliseconds since the start of the Unix epochbucket
- the time bucket to place the time value into- Returns:
- the value of the time bucket
-
timeToBucketStart
public static long timeToBucketStart(long time, CommonTimeUtil.TimeBucket bucket)
-
timeToBucketEnd
public static long timeToBucketEnd(long time, CommonTimeUtil.TimeBucket bucket)
-
-