Class JobCompletedEvent<R>
java.lang.Object
ai.redouble.nucleo.events.AbstractJobEvent
ai.redouble.nucleo.events.AbstractTerminalEvent<R>
ai.redouble.nucleo.events.JobCompletedEvent<R>
- Type Parameters:
R- the type of result
- All Implemented Interfaces:
LifecycleEvent, SuccessEvent, TerminalEvent, JobEvent, Serializable
Event published when a job completes successfully. Carries the result, as an optional
through
getResult() (empty for a null result) and directly through
result(); its message is Job completed successfully (attempt <n>).- Since:
- 0.1 (2025-09-15)
- Author:
- Andrey Santrosyan
- See Also:
-
Field Summary
Fields inherited from class AbstractTerminalEvent
attempts, llmResponses, metadata, terminatedAt -
Constructor Summary
ConstructorsConstructorDescriptionJobCompletedEvent(JobSnapshot snapshot, R result, int attempt, List<LLMResponse<?>> llmResponses, Map<String, Object> metadata) -
Method Summary
Methods inherited from class AbstractTerminalEvent
getAttempts, getCompletionTime, getDuration, getLlmResponses, getMetadata, getStartTime, getTerminatedAtMethods inherited from class AbstractJobEvent
message, setMessage, snapshot, timestampMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface TerminalEvent
getCause, getCompletionTime, getDuration, getErrorMessage, getErrorType, getLlmResponses, getMetadata, getStartTime
-
Constructor Details
-
JobCompletedEvent
public JobCompletedEvent(JobSnapshot snapshot, R result, int attempt, List<LLMResponse<?>> llmResponses, Map<String, Object> metadata)
-
-
Method Details
-
getResult
Description copied from class:AbstractTerminalEventThe result, present on a completion event only; empty on every other terminal event.- Overrides:
getResultin classAbstractTerminalEvent<R>- Returns:
- optional result
-
result
Gets the result directly (non-optional). Use this when you know the result is not null.- Returns:
- the result
-