Record Class Outcome<T>
java.lang.Object
java.lang.Record
org.tavall.couriers.api.concurrent.Outcome<T>
public record Outcome<T>(int index, StructuredTaskScope.Subtask.StatePREVIEW state, T result, Throwable error)
extends Record
Outcome relies on preview features of the Java platform:
Outcomerefers to one or more preview APIs:State.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
-
Constructor Summary
ConstructorsConstructorDescriptionOutcome(int index, StructuredTaskScope.Subtask.StatePREVIEW state, T result, Throwable error) Creates an instance of aOutcomerecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.error()Returns the value of theerrorrecord component.final inthashCode()Returns a hash code value for this object.intindex()Returns the value of theindexrecord component.result()Returns the value of theresultrecord component.state()Returns the value of thestaterecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Outcome
public Outcome(int index, StructuredTaskScope.Subtask.StatePREVIEW state, T result, Throwable error) Creates an instance of aOutcomerecord class.- Parameters:
index- the value for theindexrecord componentstate- the value for thestaterecord componentresult- the value for theresultrecord componenterror- the value for theerrorrecord component
-
-
Method Details
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
index
public int index()Returns the value of theindexrecord component.- Returns:
- the value of the
indexrecord component
-
state
Returns the value of thestaterecord component.- Returns:
- the value of the
staterecord component
-
result
Returns the value of theresultrecord component.- Returns:
- the value of the
resultrecord component
-
error
Returns the value of theerrorrecord component.- Returns:
- the value of the
errorrecord component
-
Outcomewhen preview features are enabled.