Interface CollectionContext.Builder.OptionalStep
- Enclosing class:
- CollectionContext.Builder
public static interface CollectionContext.Builder.OptionalStep
Final step of the step builder, allowing optional parameters to be set.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds and returns a newStandardCollectionContextinstance.collectionInterval(Duration collectionInterval) Sets the time interval for periodic collections.collectionTime(Instant collectionTime) Sets the collection time.isHeartbeat(boolean isHeartbeat) Sets whether this is a heartbeat collection operation.withProperty(Property<T> key, T value) Associates a given key-value pair as a property of the current step.
-
Method Details
-
collectionInterval
Sets the time interval for periodic collections. If not set, the collection is considered one-time or event-driven.- Parameters:
collectionInterval- TheDurationbetween periodic collections.- Returns:
- This step instance.
-
collectionTime
Sets the collection time. If not set, the timestamp will be set to now.- Parameters:
collectionTime- TheInstanttimestamp indicating when a collection occurred.- Returns:
- This step instance.
-
isHeartbeat
Sets whether this is a heartbeat collection operation. Default isfalseif not set.- Parameters:
isHeartbeat-Trueif this is a heartbeat operation,falseotherwise.- Returns:
- This step instance.
-
withProperty
Associates a given key-value pair as a property of the current step. This method allows configuration of additional properties for the step builder.- Type Parameters:
T- The type of the property value.- Parameters:
key- The property to be added, represented by aPropertyinstance.value- The value to associate with the given property key.- Returns:
- This step instance.
-
build
CollectionContext build()Builds and returns a newStandardCollectionContextinstance.- Returns:
- A new
StandardCollectionContextinstance with the configured values.
-