Package lazyj

Class EpochTimeRange

java.lang.Object
lazyj.EpochTimeRange

public class EpochTimeRange
extends java.lang.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 Summary

    Fields 
    Modifier and Type Field Description
    long endTime
    End time of the interval
    boolean includingEnd
    Whether or not the end of the interval is included in the range
    boolean includingStart
    Whether or not the start of the interval is included in the range
    long startTime
    Start time of the interval
  • Constructor Summary

    Constructors 
    Constructor Description
    EpochTimeRange()
    default object is valid from now (inclusive) to infinity (exclusive :) )
    EpochTimeRange​(java.lang.String dbValue)
    Initialize the interval endpoints from the database value (PostgreSQL text serialization of it)
  • Method Summary

    Modifier and Type Method Description
    java.lang.String toSQLString()  
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • 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​(java.lang.String dbValue)
      Initialize the interval endpoints from the database value (PostgreSQL text serialization of it)
      Parameters:
      dbValue - DB column value
  • Method Details

    • toString

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

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