public final class DateUtil
extends java.lang.Object
Date
valuesModifier and Type | Field and Description |
---|---|
static long |
DATE_MAX_TICKS_VALUE |
static java.util.Date |
DATE_MAX_VALUE |
static long |
DATE_MIN_TICKS_VALUE |
static java.util.Date |
DATE_MIN_VALUE |
Constructor and Description |
---|
DateUtil()
Creates a new instance of
DateUtil class |
Modifier and Type | Method and Description |
---|---|
long |
addDelta(long current,
long delta)
Adds the delta to specified value
|
boolean |
isAdditionValid(long current,
long delta)
Checks if addition is valid for specified value
|
boolean |
isDivisibleBy(long current,
long dateInterval)
Checks if specified value is divisible by passed interval
|
long |
roundUp(long current,
long dateInterval)
Rounds up specified value to date interval
|
public static final long DATE_MIN_TICKS_VALUE
public static final long DATE_MAX_TICKS_VALUE
public static final java.util.Date DATE_MIN_VALUE
public static final java.util.Date DATE_MAX_VALUE
public DateUtil()
DateUtil
classpublic boolean isAdditionValid(long current, long delta)
current
- The current value to add todelta
- The delta value to addpublic long addDelta(long current, long delta)
current
- The current valuedelta
- The delta valuepublic boolean isDivisibleBy(long current, long dateInterval)
current
- The value to checkdateInterval
- The dividerpublic long roundUp(long current, long dateInterval)
current
- The value to round updateInterval
- The date interval for rounding operation