Interface Outcome<T>
- All Known Implementing Classes:
Outcome.Failure,Outcome.Success,Outcome.TimedOut
public sealed interface Outcome<T>
permits Outcome.Success<T>, Outcome.Failure<T>, Outcome.TimedOut<T>
Result of executing an operation with a pattern.
Never throws — returns one of the sealed subtypes to allow exhaustive pattern matching.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordOperation failed with an exception.static final recordOperation succeeded and returned a value.static final recordOperation did not complete within the configured timeout. -
Method Summary
-
Method Details
-
fold
Fold over the outcome: apply one function if Success, another if Failure. A TimedOut outcome folds as a failure, passing aResilientTimeoutExceptioncarrying the exceeded timeout toonFailure.
-