Record Class PipelineResult
java.lang.Object
java.lang.Record
com.tnsai.coordination.groups.pipeline.PipelineResult
- Record Components:
taskId- task identifiersuccess- whether the pipeline completed successfullyoutput- final output from the last stagestageOutputs- output from each stagefailedStage- stage that failed (if any)startedAt- start timecompletedAt- completion timeerror- error message if failed
public record PipelineResult(String taskId, boolean success, String output, Map<String,String> stageOutputs, String failedStage, Instant startedAt, Instant completedAt, String error)
extends Record
Result of a pipeline execution.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecompletedAtrecord component.final booleanIndicates whether some other object is "equal to" this one.error()Returns the value of theerrorrecord component.Returns the value of thefailedStagerecord component.static PipelineResultfailure(String taskId, String error, String failedStage, Map<String, String> stageOutputs, Instant startedAt) Creates a failed result.Gets execution duration.final inthashCode()Returns a hash code value for this object.output()Returns the value of theoutputrecord component.Returns the value of thestageOutputsrecord component.Returns the value of thestartedAtrecord component.booleansuccess()Returns the value of thesuccessrecord component.static PipelineResultCreates a successful result.taskId()Returns the value of thetaskIdrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PipelineResult
public PipelineResult(String taskId, boolean success, String output, Map<String, String> stageOutputs, String failedStage, Instant startedAt, Instant completedAt, String error) Creates an instance of aPipelineResultrecord class.- Parameters:
taskId- the value for thetaskIdrecord componentsuccess- the value for thesuccessrecord componentoutput- the value for theoutputrecord componentstageOutputs- the value for thestageOutputsrecord componentfailedStage- the value for thefailedStagerecord componentstartedAt- the value for thestartedAtrecord componentcompletedAt- the value for thecompletedAtrecord componenterror- the value for theerrorrecord component
-
-
Method Details
-
success
public static PipelineResult success(String taskId, String output, Map<String, String> stageOutputs, Instant startedAt) Creates a successful result.- Parameters:
taskId- task IDoutput- final outputstageOutputs- per-stage outputsstartedAt- start time- Returns:
- successful result
-
failure
public static PipelineResult failure(String taskId, String error, String failedStage, Map<String, String> stageOutputs, Instant startedAt) Creates a failed result.- Parameters:
taskId- task IDerror- error messagefailedStage- stage that failedstageOutputs- partial stage outputsstartedAt- start time- Returns:
- failed result
-
getDuration
Gets execution duration.- Returns:
- duration
-
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 '=='. -
taskId
Returns the value of thetaskIdrecord component.- Returns:
- the value of the
taskIdrecord component
-
success
public boolean success()Returns the value of thesuccessrecord component.- Returns:
- the value of the
successrecord component
-
output
Returns the value of theoutputrecord component.- Returns:
- the value of the
outputrecord component
-
stageOutputs
Returns the value of thestageOutputsrecord component.- Returns:
- the value of the
stageOutputsrecord component
-
failedStage
Returns the value of thefailedStagerecord component.- Returns:
- the value of the
failedStagerecord component
-
startedAt
Returns the value of thestartedAtrecord component.- Returns:
- the value of the
startedAtrecord component
-
completedAt
Returns the value of thecompletedAtrecord component.- Returns:
- the value of the
completedAtrecord component
-
error
Returns the value of theerrorrecord component.- Returns:
- the value of the
errorrecord component
-