Class DurationSpec.LongMillisecondsBound

  • Enclosing class:
    DurationSpec

    public static final class DurationSpec.LongMillisecondsBound
    extends DurationSpec
    Represents a duration used for Cassandra configuration. The bound is [0, Long.MAX_VALUE) in milliseconds. If the user sets a different unit - we still validate that converted to milliseconds the quantity will not exceed that upper bound. (CASSANDRA-17571)
    • Constructor Detail

      • LongMillisecondsBound

        public LongMillisecondsBound​(java.lang.String value)
        Creates a DurationSpec.LongMillisecondsBound of the specified amount. The bound is [0, Long.MAX_VALUE) in milliseconds.
        Parameters:
        value - the duration
      • LongMillisecondsBound

        public LongMillisecondsBound​(long quantity,
                                     java.util.concurrent.TimeUnit unit)
        Creates a DurationSpec.LongMillisecondsBound of the specified amount in the specified unit. The bound is [0, Long.MAX_VALUE) in milliseconds.
        Parameters:
        quantity - where quantity shouldn't be bigger than Long.MAX_VALUE - 1 in milliseconds
        unit - in which the provided quantity is
      • LongMillisecondsBound

        public LongMillisecondsBound​(long milliseconds)
        Creates a DurationSpec.LongMillisecondsBound of the specified amount in milliseconds. The bound is [0, Long.MAX_VALUE) in milliseconds.
        Parameters:
        milliseconds - where milliseconds shouldn't be bigger than Long.MAX_VALUE-1
    • Method Detail

      • toMilliseconds

        public long toMilliseconds()
        Returns:
        this duration in number of milliseconds