public static final class DurationSpec.IntSecondsBound extends DurationSpec
DurationSpec.IntMillisecondsBound, DurationSpec.IntMinutesBound, DurationSpec.IntSecondsBound, DurationSpec.LongMillisecondsBound, DurationSpec.LongNanosecondsBound, DurationSpec.LongSecondsBound
Constructor and Description |
---|
IntSecondsBound(long seconds)
Creates a
DurationSpec.IntSecondsBound of the specified amount in seconds. |
IntSecondsBound(long quantity,
java.util.concurrent.TimeUnit unit)
Creates a
DurationSpec.IntSecondsBound of the specified amount in the specified unit. |
IntSecondsBound(java.lang.String value)
Creates a
DurationSpec.IntSecondsBound of the specified amount. |
Modifier and Type | Method and Description |
---|---|
static DurationSpec.IntSecondsBound |
inSecondsString(java.lang.String value)
Creates a
DurationSpec.IntSecondsBound of the specified amount in seconds, expressed either as the
number of seconds without unit, or as a regular quantity with unit. |
int |
toMilliseconds()
Returns this duration in number of milliseconds as an
int |
int |
toSeconds()
Returns this duration in number of seconds as an
int |
public IntSecondsBound(java.lang.String value)
DurationSpec.IntSecondsBound
of the specified amount. The bound is [0, Integer.MAX_VALUE) in seconds.
The bound is [0, Integer.MAX_VALUE) in seconds.value
- the durationpublic IntSecondsBound(long quantity, java.util.concurrent.TimeUnit unit)
DurationSpec.IntSecondsBound
of the specified amount in the specified unit.
The bound is [0, Integer.MAX_VALUE) in seconds.quantity
- where quantity shouldn't be bigger than Integer.MAX_VALUE - 1 in secondsunit
- in which the provided quantity ispublic IntSecondsBound(long seconds)
DurationSpec.IntSecondsBound
of the specified amount in seconds.
The bound is [0, Integer.MAX_VALUE) in seconds.seconds
- where seconds shouldn't be bigger than Integer.MAX_VALUE-1public static DurationSpec.IntSecondsBound inSecondsString(java.lang.String value)
DurationSpec.IntSecondsBound
of the specified amount in seconds, expressed either as the
number of seconds without unit, or as a regular quantity with unit.
Used in the Converters for a few parameters which changed only type, but not names
The bound is [0, Integer.MAX_VALUE) in seconds.value
- where value shouldn't be bigger than Integer.MAX_VALUE-1 in secondspublic int toMilliseconds()
int
Integer.MAX_VALUE
if the number of milliseconds is too large.public int toSeconds()
int
Integer.MAX_VALUE
if the number of seconds is too large.Copyright © 2009-2022 The Apache Software Foundation