Package lazyj
Class EpochTimeRange
java.lang.Object
lazyj.EpochTimeRange
Wrap a PostgreSQL int8range column type with some simple operations. DBFunctions is now aware of this and can use it in
DBFunctions.composeInsert(String, java.util.Map)
and DBFunctions.composeUpdate(String, java.util.Map, java.util.Collection)
. If you want to parse a column simply say:
EpochTimeRange range = new EpochTimeRange(db.gets("validity"));
- Since:
- 2020-03-03
- Author:
- costing
-
Field Summary
FieldsModifier and TypeFieldDescriptionlong
End time of the intervalboolean
Whether or not the end of the interval is included in the rangeboolean
Whether or not the start of the interval is included in the rangelong
Start time of the interval -
Constructor Summary
ConstructorsConstructorDescriptiondefault object is valid from now (inclusive) to infinity (exclusive :) )EpochTimeRange
(String dbValue) Initialize the interval endpoints from the database value (PostgreSQL text serialization of it) -
Method Summary
-
Field Details
-
includingStart
public boolean includingStartWhether or not the start of the interval is included in the range -
includingEnd
public boolean includingEndWhether or not the end of the interval is included in the range -
startTime
public long startTimeStart time of the interval -
endTime
public long endTimeEnd time of the interval
-
-
Constructor Details
-
EpochTimeRange
public EpochTimeRange()default object is valid from now (inclusive) to infinity (exclusive :) ) -
EpochTimeRange
Initialize the interval endpoints from the database value (PostgreSQL text serialization of it)- Parameters:
dbValue
- DB column value
-
-
Method Details