Class Durations


  • public final class Durations
    extends java.lang.Object
    Duration and long utilities.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Durations()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.time.Duration ofSafeNanos​(java.time.Duration duration)
      Returns either the duration else a Duration containing the max seconds that can safely be converted to nanos without overflowing.
      • Methods inherited from class java.lang.Object

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

      • MAX_SECONDS_PER_LONG

        static long MAX_SECONDS_PER_LONG
      • MAX_SAFE_NANOS_DURATION

        static java.time.Duration MAX_SAFE_NANOS_DURATION
    • Constructor Detail

      • Durations

        private Durations()
    • Method Detail

      • ofSafeNanos

        public static java.time.Duration ofSafeNanos​(java.time.Duration duration)
        Returns either the duration else a Duration containing the max seconds that can safely be converted to nanos without overflowing.