Class DurationKt
-
- All Implemented Interfaces:
public final class DurationKt
-
-
Field Summary
Fields Modifier and Type Field Description private final static Durationnanosprivate final static Durationnanosprivate final static Durationmicrosprivate final static Durationmicrosprivate final static Durationmsprivate final static Durationmsprivate final static Durationsecsprivate final static Durationsecsprivate final static Durationhoursprivate final static Durationhoursprivate final static Durationminsprivate final static Durationminsprivate final static Durationdaysprivate final static Durationdaysprivate final static DurationMIN_DURATIONprivate final static DurationMAX_DURATION
-
Method Summary
Modifier and Type Method Description final DurationgetNanos()final DurationgetNanos()final DurationgetMicros()final DurationgetMicros()final DurationgetMs()final DurationgetMs()final DurationgetSecs()final DurationgetSecs()final DurationgetHours()final DurationgetHours()final DurationgetMins()final DurationgetMins()final DurationgetDays()final DurationgetDays()final DurationgetMIN_DURATION()final DurationgetMAX_DURATION()final static Durationtimes(Duration $self, Integer x)final static Durationtimes(Duration $self, Long x)final static Durationtimes(Integer $self, Duration x)final static Durationtimes(Long $self, Duration x)final static Durationtimes(Duration $self, Double other)final static Durationtimes(Double $self, Duration other)final static Doublediv(Duration $self, Duration other)final static Durationdiv(Duration $self, Double other)final static Durationdiv(Duration $self, Long other)final static LongtoRoundedMillis(Duration $self)Converts this duration to the total length in milliseconds, rounded to nearest. final static LongtoMicros(Duration $self)Converts this duration to the total length in microseconds. final static LongtoRoundedMicros(Duration $self)Converts this duration to the total length in microseconds, rounded to nearest. final static DoubletoDouble(Duration $self)final static DoubletoDoubleMillis(Duration $self)final static DurationdurationOfDoubleSeconds(Double duration)final static BooleanisFinite(Duration $self)final static BooleanisInfinite(Duration $self)final static DurationunaryMinus(Duration $self)final static Durationabs(Duration duration)final static <T extends Any> DurationsumOf(Iterable<T> $self, Function1<T, Duration> selector)final static Durationmax(Duration a, Duration b)Returns the maximum of two Durations final static Durationmin(Duration a, Duration b)Returns the minimum of two Durations final static DurationcoerceIn(Duration $self, Duration minimumValue, Duration maximumValue)Ensures that this value lies in the specified range minimumValue.. final static DurationroundUpTo(Duration $self, Duration resolution)final static DurationroundDownTo(Duration $self, Duration resolution)final static StringformatMilli(Duration $self)-
-
Method Detail
-
getMIN_DURATION
final Duration getMIN_DURATION()
-
getMAX_DURATION
final Duration getMAX_DURATION()
-
toRoundedMillis
final static Long toRoundedMillis(Duration $self)
Converts this duration to the total length in milliseconds, rounded to nearest.
-
toMicros
final static Long toMicros(Duration $self)
Converts this duration to the total length in microseconds.
If this duration is too large to fit in a
longmicroseconds, then an exception is thrown.If this duration has greater than microseconds precision, then the conversion will drop any excess precision information as though the amount in nanoseconds was subject to integer division by one thousand.
- Returns:
the total length of the duration in microseconds
-
toRoundedMicros
final static Long toRoundedMicros(Duration $self)
Converts this duration to the total length in microseconds, rounded to nearest.
-
toDoubleMillis
final static Double toDoubleMillis(Duration $self)
-
durationOfDoubleSeconds
final static Duration durationOfDoubleSeconds(Double duration)
-
isInfinite
final static Boolean isInfinite(Duration $self)
-
unaryMinus
final static Duration unaryMinus(Duration $self)
-
sumOf
final static <T extends Any> Duration sumOf(Iterable<T> $self, Function1<T, Duration> selector)
-
coerceIn
final static Duration coerceIn(Duration $self, Duration minimumValue, Duration maximumValue)
Ensures that this value lies in the specified range minimumValue..maximumValue.
- Returns:
this value if it's in the range, or minimumValue if this value is less than minimumValue, or maximumValue if this value is greater than maximumValue.
-
roundDownTo
final static Duration roundDownTo(Duration $self, Duration resolution)
-
formatMilli
final static String formatMilli(Duration $self)
-
-
-
-