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 newStandardCollectionContext
instance.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
- TheDuration
between periodic collections.- Returns:
- This step instance.
-
collectionTime
Sets the collection time. If not set, the timestamp will be set to now.- Parameters:
collectionTime
- TheInstant
timestamp indicating when a collection occurred.- Returns:
- This step instance.
-
isHeartbeat
Sets whether this is a heartbeat collection operation. Default isfalse
if not set.- Parameters:
isHeartbeat
-True
if this is a heartbeat operation,false
otherwise.- 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 aProperty
instance.value
- The value to associate with the given property key.- Returns:
- This step instance.
-
build
CollectionContext build()Builds and returns a newStandardCollectionContext
instance.- Returns:
- A new
StandardCollectionContext
instance with the configured values.
-