Class 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 Detail

      • IntMinutesBound

        public IntMinutesBound​(java.lang.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,
                               java.util.concurrent.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 Detail

      • 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.