Class Internal
- java.lang.Object
-
- com.google.common.util.concurrent.Internal
-
final class Internal extends java.lang.ObjectThis class is forcom.google.common.util.concurrentuse only!
-
-
Constructor Summary
Constructors Modifier Constructor Description privateInternal()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static longtoNanosSaturated(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_VALUEorLong.MIN_VALUE. This behavior can be useful when decomposing a duration in order to call a legacy API which requires along, TimeUnitpair.
-
-