Package com.yworkflow.common
Interface WorkflowFunction<A,R,T extends Throwable>
- Type Parameters:
A- the type of the input to the functionR- the type of the result of the functionT- the type of exception that may be thrown
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A functional interface that represents a function that takes one argument and returns a result,
potentially throwing a checked exception. This is similar to Java's
Function but allows for checked exceptions.
WorkflowFunction is used throughout the yWorkflow system for operations that may throw checked exceptions, such as workflow extensions, validators, and business logic functions.
This interface is particularly useful in workflow contexts where operations may fail due to business rules, external service calls, or other recoverable conditions that should be handled explicitly.
- Since:
- 1.0
- See Also:
-
Method Summary
-
Method Details
-
apply
Applies this function to the given argument.- Parameters:
t- the function argument- Returns:
- the function result
- Throws:
T- if the function execution fails
-