public final class EpochTimeRange extends java.lang.Object implements UsesCustomNull
Modifier and Type | Field and Description |
---|---|
static EpochTimeRange |
FIVE_SECONDS |
static EpochTimeRange |
FROM_1970_TO_MAX |
static EpochTimeRange |
FROM_MIN_TO_1970 |
static EpochTimeRange |
FROM_MIN_TO_MAX |
static EpochTimeRange |
NULL
Fulfills the soft contract of
UsesCustomNull - used for isNull() . |
static EpochTimeRange |
ZERO |
Constructor and Description |
---|
EpochTimeRange(EpochTime from,
EpochTime to)
Returns a new instance representing the time range between the given epoch times.
|
EpochTimeRange(long from,
long to)
Returns a new instance representing the time range between the given epoch times as primitive longs.
|
Modifier and Type | Method and Description |
---|---|
static EpochTimeRange |
denull(EpochTimeRange range_nullable) |
EpochTime |
from()
Returns the "from" date passed into the constructor,
or
EpochTime.NULL if null
was originally passed in. |
static EpochTimeRange |
from1970_toGiven(EpochTime to)
Returns a new instance representing the time range from 1970 to the given value.
|
static EpochTimeRange |
from1970_toNow()
Returns a new instance representing the time range from 1970 to now.
|
static EpochTimeRange |
fromGiven_toGiven(EpochTime from,
EpochTime to)
Basically just a more readable overload for the normal constructor
EpochTimeRange(EpochTime, EpochTime) . |
static EpochTimeRange |
fromGiven_toMax(EpochTime from)
Returns a new instance representing the time range from the given value to
Long.MAX_VALUE . |
static EpochTimeRange |
fromGiven_toNow(EpochTime from)
Returns a new instance representing the time range from the given value to now.
|
static EpochTimeRange |
fromMin_toGiven(EpochTime to)
Returns a new instance representing the time range from
Long.MIN_VALUE to the given value. |
long |
getDelta()
|
boolean |
gt(EpochTimeRange otherRange)
"greater than" comparison.
|
boolean |
gte(EpochTimeRange otherRange)
"greater than or equal" comparison.
|
static EpochTimeRange |
instant(EpochTime time)
Returns a new instance representing an instant zero length time range.
|
boolean |
isInvalid()
|
boolean |
isInvalidOrZero()
See
isInvalid() and isZero() . |
boolean |
isNull()
|
boolean |
isValid()
|
boolean |
isZero()
|
boolean |
lt(EpochTimeRange otherRange)
"less than" comparison.
|
boolean |
lte(EpochTimeRange otherRange)
"less than or equal" comparison.
|
EpochTime |
to()
Returns the "to" date passed into the constructor,
or
EpochTime.NULL if null
was originally passed in. |
public static final EpochTimeRange NULL
UsesCustomNull
- used for isNull()
.public static final EpochTimeRange FROM_MIN_TO_1970
public static final EpochTimeRange FROM_MIN_TO_MAX
public static final EpochTimeRange FROM_1970_TO_MAX
public static final EpochTimeRange ZERO
public static final EpochTimeRange FIVE_SECONDS
public EpochTimeRange(EpochTime from, EpochTime to)
public EpochTimeRange(long from, long to)
public static EpochTimeRange fromGiven_toMax(EpochTime from)
Long.MAX_VALUE
.public static EpochTimeRange fromGiven_toNow(EpochTime from)
public static EpochTimeRange fromGiven_toGiven(EpochTime from, EpochTime to)
EpochTimeRange(EpochTime, EpochTime)
.public static EpochTimeRange from1970_toGiven(EpochTime to)
public static EpochTimeRange fromMin_toGiven(EpochTime to)
Long.MIN_VALUE
to the given value.public static EpochTimeRange from1970_toNow()
public static EpochTimeRange instant(EpochTime time)
public static EpochTimeRange denull(EpochTimeRange range_nullable)
public EpochTime from()
EpochTime.NULL
if null
was originally passed in.public EpochTime to()
EpochTime.NULL
if null
was originally passed in.public boolean isValid()
public boolean isInvalid()
public boolean isZero()
public long getDelta()
public boolean isInvalidOrZero()
isInvalid()
and isZero()
.public boolean isNull()
isNull
in interface UsesCustomNull
public boolean lt(EpochTimeRange otherRange)
public boolean lte(EpochTimeRange otherRange)
public boolean gt(EpochTimeRange otherRange)
public boolean gte(EpochTimeRange otherRange)