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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA builder class for constructing DebounceBatchConfig instances. -
Constructor Summary
ConstructorsConstructorDescriptionDebounceBatchConfig(String key, Duration debounceTime, Duration maxWaitTime, int maxBatchSize) Constructs a new DebounceBatchConfig instance with validation. -
Method Summary
Modifier and TypeMethodDescriptionstatic DebounceBatchConfig.Builderbuilder()Creates a new Builder instance for constructing a DebounceBatchConfig.static DebounceBatchConfigcreateDefault(String key) Creates a default DebounceBatchConfig instance with the specified key.Returns the value of thedebounceTimerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.key()Returns the value of thekeyrecord component.intReturns the value of themaxBatchSizerecord component.Returns the value of themaxWaitTimerecord component.final StringtoString()Returns a string representation of this record class.
-
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
Creates a new Builder instance for constructing a DebounceBatchConfig.- Returns:
- A new Builder instance.
-
createDefault
Creates a default DebounceBatchConfig instance with the specified key.- Parameters:
key- The unique identifier for the configuration.- Returns:
- A default DebounceBatchConfig instance.
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
key
Returns the value of thekeyrecord component.- Returns:
- the value of the
keyrecord component
-
debounceTime
Returns the value of thedebounceTimerecord component.- Returns:
- the value of the
debounceTimerecord component
-
maxWaitTime
Returns the value of themaxWaitTimerecord component.- Returns:
- the value of the
maxWaitTimerecord component
-
maxBatchSize
public int maxBatchSize()Returns the value of themaxBatchSizerecord component.- Returns:
- the value of the
maxBatchSizerecord component
-