Class Filters.RejectSubtypes
java.lang.Object
net.engio.mbassy.listener.Filters.RejectSubtypes
- All Implemented Interfaces:
IMessageFilter
- Enclosing class:
Filters
This filter will only accept messages of the exact same type
as specified for the handler. Subclasses (this includes interface implementations)
will be rejected.
NOTE: The same functionality (with better performance) is achieved using
rejectSubtypes = true
in the @Handler annotation-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaccepts(Object event, SubscriptionContext context) Check whether the message matches some criteria
-
Constructor Details
-
RejectSubtypes
public RejectSubtypes()
-
-
Method Details
-
accepts
Description copied from interface:IMessageFilterCheck whether the message matches some criteria- Specified by:
acceptsin interfaceIMessageFilter- Parameters:
event- The message to be handled by the handlercontext- The context object containing a description of the message handler and the bus environment- Returns:
- true: if the message matches the criteria and should be delivered to the handler false: otherwise
-