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
-
Constructor Details
-
RoundTimestamp
public RoundTimestamp()
-
-
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 comparetheirs
- the second timestamp to compare- Returns:
- the boolean
-