Record Class DebounceBatchConfig

java.lang.Object
java.lang.Record
com.inductiveautomation.historian.gateway.api.storage.strategy.DebounceBatchConfig
Record Components:
key - A unique identifier for the configuration.
debounceTime - The minimum time to wait before processing a batch.
maxWaitTime - The maximum time to wait before forcing a batch to process.
maxBatchSize - The maximum number of items allowed in a batch.

public record DebounceBatchConfig(String key, Duration debounceTime, Duration maxWaitTime, int maxBatchSize) extends Record
A record representing the configuration for debouncing and batching operations.
  • Constructor Details

    • DebounceBatchConfig

      public DebounceBatchConfig(String key, Duration debounceTime, Duration maxWaitTime, int maxBatchSize)
      Constructs a new DebounceBatchConfig instance with validation.
      Throws:
      NullPointerException - if any of the required parameters are null.
      IllegalArgumentException - if any of the parameters are invalid: - `debounceTime` and `maxWaitTime` must be positive. - `maxBatchSize` must be greater than 0. - `debounceTime` cannot be larger than `maxWaitTime`.
  • Method Details

    • builder

      public static DebounceBatchConfig.Builder builder()
      Creates a new Builder instance for constructing a DebounceBatchConfig.
      Returns:
      A new Builder instance.
    • createDefault

      public static DebounceBatchConfig createDefault(String key)
      Creates a default DebounceBatchConfig instance with the specified key.
      Parameters:
      key - The unique identifier for the configuration.
      Returns:
      A default DebounceBatchConfig instance.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • key

      public String key()
      Returns the value of the key record component.
      Returns:
      the value of the key record component
    • debounceTime

      public Duration debounceTime()
      Returns the value of the debounceTime record component.
      Returns:
      the value of the debounceTime record component
    • maxWaitTime

      public Duration maxWaitTime()
      Returns the value of the maxWaitTime record component.
      Returns:
      the value of the maxWaitTime record component
    • maxBatchSize

      public int maxBatchSize()
      Returns the value of the maxBatchSize record component.
      Returns:
      the value of the maxBatchSize record component