Class TimeUtils


  • final class TimeUtils
    extends java.lang.Object
    Util class for Timestamp and Duration.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private TimeUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) static long checkedAdd​(long x, long y)
      Adds two longs and throws an ArithmeticException if the result overflows.
      (package private) static int compareLongs​(long x, long y)
      Compares two longs.
      • Methods inherited from class java.lang.Object

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

      • TimeUtils

        private TimeUtils()
    • Method Detail

      • compareLongs

        static int compareLongs​(long x,
                                long y)
        Compares two longs. This functionality is provided by Long.compare(long, long) in Java 7.
      • checkedAdd

        static long checkedAdd​(long x,
                               long y)
        Adds two longs and throws an ArithmeticException if the result overflows. This functionality is provided by Math.addExact(long, long) in Java 8.