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 class
A 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.Builder
builder()
Creates a new Builder instance for constructing a DebounceBatchConfig.static DebounceBatchConfig
createDefault
(String key) Creates a default DebounceBatchConfig instance with the specified key.Returns the value of thedebounceTime
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.key()
Returns the value of thekey
record component.int
Returns the value of themaxBatchSize
record component.Returns the value of themaxWaitTime
record component.final String
toString()
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 thekey
record component.- Returns:
- the value of the
key
record component
-
debounceTime
Returns the value of thedebounceTime
record component.- Returns:
- the value of the
debounceTime
record component
-
maxWaitTime
Returns the value of themaxWaitTime
record component.- Returns:
- the value of the
maxWaitTime
record component
-
maxBatchSize
public int maxBatchSize()Returns the value of themaxBatchSize
record component.- Returns:
- the value of the
maxBatchSize
record component
-