Class Internal
- java.lang.Object
-
- com.google.common.util.concurrent.Internal
-
final class Internal extends java.lang.Object
This class is forcom.google.common.util.concurrent
use only!
-
-
Constructor Summary
Constructors Modifier Constructor Description private
Internal()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static long
toNanosSaturated(java.time.Duration duration)
Returns the number of nanoseconds of the given duration without throwing or overflowing.
-
-
-
Method Detail
-
toNanosSaturated
static long toNanosSaturated(java.time.Duration duration)
Returns the number of nanoseconds of the given duration without throwing or overflowing.Instead of throwing
ArithmeticException
, this method silently saturates to eitherLong.MAX_VALUE
orLong.MIN_VALUE
. This behavior can be useful when decomposing a duration in order to call a legacy API which requires along, TimeUnit
pair.
-
-