Class Internal
java.lang.Object
com.google.common.util.concurrent.Internal
This class is for
com.google.common.util.concurrent use only!-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static longtoNanosSaturated(Duration duration) Returns the number of nanoseconds of the given duration without throwing or overflowing.
-
Constructor Details
-
Internal
private Internal()
-
-
Method Details
-
toNanosSaturated
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.
-