Record Class MatrixResult
java.lang.Object
java.lang.Record
com.tnsai.coordination.groups.matrix.MatrixResult
- Record Components:
taskId- task identifiersuccess- whether the operation succeededoutput- aggregated outputdimension- dimension in which execution occurredmemberOutputs- per-member outputsstartedAt- start timecompletedAt- completion timeerror- error message if failed
public record MatrixResult(String taskId, boolean success, String output, String dimension, Map<String,String> memberOutputs, Instant startedAt, Instant completedAt, String error)
extends Record
Result of a matrix organization operation.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecompletedAtrecord component.Returns the value of thedimensionrecord component.final booleanIndicates whether some other object is "equal to" this one.error()Returns the value of theerrorrecord component.static MatrixResultCreates a failed result.Gets execution duration.final inthashCode()Returns a hash code value for this object.Returns the value of thememberOutputsrecord component.output()Returns the value of theoutputrecord component.Returns the value of thestartedAtrecord component.booleansuccess()Returns the value of thesuccessrecord component.static MatrixResultsuccess(String taskId, String output, String dimension, Map<String, String> memberOutputs, Instant startedAt) Creates a successful result.taskId()Returns the value of thetaskIdrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
MatrixResult
public MatrixResult(String taskId, boolean success, String output, String dimension, Map<String, String> memberOutputs, Instant startedAt, Instant completedAt, String error) Creates an instance of aMatrixResultrecord class.- Parameters:
taskId- the value for thetaskIdrecord componentsuccess- the value for thesuccessrecord componentoutput- the value for theoutputrecord componentdimension- the value for thedimensionrecord componentmemberOutputs- the value for thememberOutputsrecord componentstartedAt- the value for thestartedAtrecord componentcompletedAt- the value for thecompletedAtrecord componenterror- the value for theerrorrecord component
-
-
Method Details
-
success
public static MatrixResult success(String taskId, String output, String dimension, Map<String, String> memberOutputs, Instant startedAt) Creates a successful result.- Parameters:
taskId- task IDoutput- aggregated outputdimension- dimensionmemberOutputs- per-member outputsstartedAt- start time- Returns:
- successful result
-
failure
public static MatrixResult failure(String taskId, String error, String dimension, Instant startedAt) Creates a failed result.- Parameters:
taskId- task IDerror- error messagedimension- dimensionstartedAt- 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
-
dimension
Returns the value of thedimensionrecord component.- Returns:
- the value of the
dimensionrecord component
-
memberOutputs
Returns the value of thememberOutputsrecord component.- Returns:
- the value of the
memberOutputsrecord 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
-