- Type Parameters:
Context
- Context type, this will be the input that is used to generate the response
Result
- Response type, this is what is produced by the service ("provided")
- All Superinterfaces:
java.util.function.Function<@NonNull Context,@Nullable Result>
- All Known Subinterfaces:
ConsumerService<Context>
, PartialResultService<Context,Result,Chunked>
, SideEffectService<Context>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
public interface Service<Context,Result>
extends java.util.function.Function<@NonNull Context,@Nullable Result>
A service is anything that can take in a context, and produce a response. Most service
implementations will be side effect free, although some service implementations will have side
effects. Those that do, should be clearly labeled