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
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.LongMicrosecondsBound, DurationSpec.LongMillisecondsBound, DurationSpec.LongNanosecondsBound, DurationSpec.LongSecondsBound -
Constructor Summary
ConstructorsConstructorDescriptionIntMinutesBound(long minutes) Creates aDurationSpec.IntMinutesBoundof the specified amount in minutes.IntMinutesBound(long quantity, TimeUnit unit) Creates aDurationSpec.IntMinutesBoundof the specified amount in the specified unit.IntMinutesBound(String value) Creates aDurationSpec.IntMinutesBoundof the specified amount. -
Method Summary
Modifier and TypeMethodDescriptionintReturns this duration in number of milliseconds as anintintReturns this duration in number of minutes as anintintReturns this duration in number of seconds as anint
-
Constructor Details
-
IntMinutesBound
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
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 Details
-
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.
-