Package io.fluxcapacitor.common.handling
Class HandlerInspector.ObjectHandlerMatcher<M>
java.lang.Object
io.fluxcapacitor.common.handling.HandlerInspector.ObjectHandlerMatcher<M>
- All Implemented Interfaces:
HandlerMatcher<Object,
M>
- Enclosing class:
HandlerInspector
public static class HandlerInspector.ObjectHandlerMatcher<M>
extends Object
implements HandlerMatcher<Object,M>
A composite
HandlerMatcher
that delegates to a list of individual matchers.
Supports invoking one or multiple methods depending on configuration.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns whether the given message can be handled by a handler instance of typeT
.getInvoker
(Object target, M message) Attempts to resolve aHandlerInvoker
for the given target instance and message.matchingMethods
(M message) Returns a stream of methods from the target class that match the given message.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.fluxcapacitor.common.handling.HandlerMatcher
or
-
Constructor Details
-
ObjectHandlerMatcher
public ObjectHandlerMatcher()
-
-
Method Details
-
canHandle
Description copied from interface:HandlerMatcher
Returns whether the given message can be handled by a handler instance of typeT
. This is a lightweight check and may be used for fast filtering or diagnostics.- Specified by:
canHandle
in interfaceHandlerMatcher<Object,
M> - Parameters:
message
- the message to check- Returns:
true
if the matcher may be able to produce an invoker for the given message
-
matchingMethods
Description copied from interface:HandlerMatcher
Returns a stream of methods from the target class that match the given message. Typically used for diagnostics or documentation tools.- Specified by:
matchingMethods
in interfaceHandlerMatcher<Object,
M> - Parameters:
message
- the message to match against- Returns:
- a stream of matching
Executable
handler methods
-
getInvoker
Description copied from interface:HandlerMatcher
Attempts to resolve aHandlerInvoker
for the given target instance and message.- Specified by:
getInvoker
in interfaceHandlerMatcher<Object,
M> - Parameters:
target
- the handler objectmessage
- the message to be handled- Returns:
- an optional invoker if the message is supported by the target; empty otherwise
-