Package org.apache.cassandra.config
Class DurationSpec.IntMinutesBound
- java.lang.Object
-
- org.apache.cassandra.config.DurationSpec
-
- org.apache.cassandra.config.DurationSpec.IntMinutesBound
-
- Enclosing class:
- DurationSpec
public static final class DurationSpec.IntMinutesBound extends DurationSpec
Represents a duration used for Cassandra configuration. The bound is [0, Integer.MAX_VALUE) in minutes. If the user sets a different unit - we still validate that converted to minutes the quantity will not exceed that upper bound. (CASSANDRA-17571)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.cassandra.config.DurationSpec
DurationSpec.IntMillisecondsBound, DurationSpec.IntMinutesBound, DurationSpec.IntSecondsBound, DurationSpec.LongMillisecondsBound, DurationSpec.LongNanosecondsBound, DurationSpec.LongSecondsBound
-
-
Constructor Summary
Constructors Constructor Description IntMinutesBound(long minutes)Creates aDurationSpec.IntMinutesBoundof the specified amount in minutes.IntMinutesBound(long quantity, java.util.concurrent.TimeUnit unit)Creates aDurationSpec.IntMinutesBoundof the specified amount in the specified unit.IntMinutesBound(java.lang.String value)Creates aDurationSpec.IntMinutesBoundof the specified amount.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description inttoMilliseconds()Returns this duration in number of milliseconds as anintinttoMinutes()Returns this duration in number of minutes as anintinttoSeconds()Returns this duration in number of seconds as anint
-
-
-
Constructor Detail
-
IntMinutesBound
public IntMinutesBound(java.lang.String value)
Creates aDurationSpec.IntMinutesBoundof the specified amount. The bound is [0, Integer.MAX_VALUE) in minutes. The bound is [0, Integer.MAX_VALUE) in minutes.- Parameters:
value- the duration
-
IntMinutesBound
public IntMinutesBound(long quantity, java.util.concurrent.TimeUnit unit)Creates aDurationSpec.IntMinutesBoundof the specified amount in the specified unit. The bound is [0, Integer.MAX_VALUE) in minutes.- Parameters:
quantity- where quantity shouldn't be bigger than Integer.MAX_VALUE - 1 in minutesunit- in which the provided quantity is
-
IntMinutesBound
public IntMinutesBound(long minutes)
Creates aDurationSpec.IntMinutesBoundof the specified amount in minutes. The bound is [0, Integer.MAX_VALUE) in minutes.- Parameters:
minutes- where minutes shouldn't be bigger than Integer.MAX_VALUE-1
-
-
Method Detail
-
toMilliseconds
public int toMilliseconds()
Returns this duration in number of milliseconds as anint- Returns:
- this duration in number of milliseconds or
Integer.MAX_VALUEif the number of milliseconds is too large.
-
toSeconds
public int toSeconds()
Returns this duration in number of seconds as anint- Returns:
- this duration in number of seconds or
Integer.MAX_VALUEif the number of seconds is too large.
-
toMinutes
public int toMinutes()
Returns this duration in number of minutes as anint- Returns:
- this duration in number of minutes or
Integer.MAX_VALUEif the number of minutes is too large.
-
-