Class HandlerInspector.ObjectHandlerMatcher<M>
java.lang.Object
io.fluxzero.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 TypeMethodDescriptionbooleanReturns whether the given message can be handled by a handler instance of typeT.getInvoker(Object target, M message) Attempts to resolve aHandlerInvokerfor 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 Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface HandlerMatcher
or
-
Constructor Details
-
ObjectHandlerMatcher
public ObjectHandlerMatcher()
-
-
Method Details
-
canHandle
Description copied from interface:HandlerMatcherReturns 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:
canHandlein interfaceHandlerMatcher<Object,M> - Parameters:
message- the message to check- Returns:
trueif the matcher may be able to produce an invoker for the given message
-
matchingMethods
Description copied from interface:HandlerMatcherReturns a stream of methods from the target class that match the given message. Typically used for diagnostics or documentation tools.- Specified by:
matchingMethodsin interfaceHandlerMatcher<Object,M> - Parameters:
message- the message to match against- Returns:
- a stream of matching
Executablehandler methods
-
getInvoker
Description copied from interface:HandlerMatcherAttempts to resolve aHandlerInvokerfor the given target instance and message.- Specified by:
getInvokerin 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
-