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)
  • Constructor Details

    • IntMinutesBound

      public IntMinutesBound(String value)
      Creates a DurationSpec.IntMinutesBound of 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, TimeUnit unit)
      Creates a DurationSpec.IntMinutesBound of 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 minutes
      unit - in which the provided quantity is
    • IntMinutesBound

      public IntMinutesBound(long minutes)
      Creates a DurationSpec.IntMinutesBound of 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 an int
      Returns:
      this duration in number of milliseconds or Integer.MAX_VALUE if the number of milliseconds is too large.
    • toSeconds

      public int toSeconds()
      Returns this duration in number of seconds as an int
      Returns:
      this duration in number of seconds or Integer.MAX_VALUE if the number of seconds is too large.
    • toMinutes

      public int toMinutes()
      Returns this duration in number of minutes as an int
      Returns:
      this duration in number of minutes or Integer.MAX_VALUE if the number of minutes is too large.