Package lazyj

Class EpochTimeRange

java.lang.Object
lazyj.EpochTimeRange

public class EpochTimeRange extends Object
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 Details

    • includingStart

      public boolean includingStart
      Whether or not the start of the interval is included in the range
    • includingEnd

      public boolean includingEnd
      Whether or not the end of the interval is included in the range
    • startTime

      public long startTime
      Start time of the interval
    • endTime

      public long endTime
      End time of the interval
  • Constructor Details

    • EpochTimeRange

      public EpochTimeRange()
      default object is valid from now (inclusive) to infinity (exclusive :) )
    • EpochTimeRange

      public EpochTimeRange(String dbValue)
      Initialize the interval endpoints from the database value (PostgreSQL text serialization of it)
      Parameters:
      dbValue - DB column value
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toSQLString

      public String toSQLString()
      Returns:
      SQL representation of the value for this tuple