Package io.fluxcapacitor.common.handling
Class HandlerConfiguration<M>
java.lang.Object
io.fluxcapacitor.common.handling.HandlerConfiguration<M>
- Type Parameters:
M
- the message wrapper type this configuration applies to
Configuration object used to define how message handler methods are selected and filtered for a given message type.
This configuration is passed to HandlerInspector
and HandlerMatcher
instances to determine:
- Which methods should be considered as valid message handlers,
- Whether multiple methods on the same target are allowed to handle the same message,
- And whether a particular message is eligible for handling by a given method.
The generic type M
represents the expected message wrapper type (e.g. HasMessage
or a subclass).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionOptional
<? extends Annotation> Retrieves the configured method annotation on the given method, if present.boolean
methodMatches
(Class<?> c, Executable e) Determines whether the given method is eligible to handle messages according to this configuration.
-
Constructor Details
-
HandlerConfiguration
public HandlerConfiguration()
-
-
Method Details
-
methodMatches
Determines whether the given method is eligible to handle messages according to this configuration.This includes both:
- Checking that the method is annotated with
methodAnnotation
(if applicable), and - That it passes the
handlerFilter
.
- Parameters:
c
- the class owning the methode
- the method to check- Returns:
true
if the method should be included as a handler
- Checking that the method is annotated with
-
getAnnotation
Retrieves the configured method annotation on the given method, if present.- Parameters:
e
- the method to inspect- Returns:
- an optional containing the annotation if present, or empty otherwise
-