Package tenapull.util

Class RoundTimestamp

java.lang.Object
tenapull.util.RoundTimestamp

public class RoundTimestamp
extends java.lang.Object
A static utility for comparing java.sql.Timestamps by rounding to the nearest second. MySQL rounds timestamps when it stores them, so in order to determine equality between a persisted timestamp and a newly deserialized one, the deserialized timestamp needs to be rounded to the nearest second
  • Constructor Summary

    Constructors 
    Constructor Description
    RoundTimestamp()  
  • Method Summary

    Modifier and Type Method Description
    static boolean equals​(java.sql.Timestamp mine, java.sql.Timestamp theirs)
    Compare two timestamps by rounding them to the nearest second

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • equals

      public static boolean equals​(java.sql.Timestamp mine, java.sql.Timestamp theirs)
      Compare two timestamps by rounding them to the nearest second
      Parameters:
      mine - the first timestamp to compare
      theirs - the second timestamp to compare
      Returns:
      the boolean