public class BusMatcherSugar extends Object
BusMatcher
elements.Constructor and Description |
---|
BusMatcherSugar() |
Modifier and Type | Method and Description |
---|---|
static <E extends BusEvent,A> |
actionEqualWith(A aAction)
Factory method to create an "EQUAL WITH" matcher for the given action
compared with the action stored in the
EventMetaData . |
static BusMatcher |
aliasEqualWith(String aAlias)
Factory method to create an "EQUAL WITH" matcher for the given name
compared with the name stored in the
EventMetaData . |
static BusMatcher |
and(BusMatcher... aEventMatchers)
Factory method to create an "AND" matcher for the given matchers.
|
static BusMatcher |
catchAll()
Catches all events, no matching is done.
|
static BusMatcher |
catchNone()
Catches no event, no matching is done.
|
static BusMatcher |
channelEqualWith(String aChannel)
Factory method to create an "EQUAL WITH" matcher for the given channel
compared with the channel stored in the
EventMetaData . |
static BusMatcher |
groupEqualWith(String aGroup)
Factory method to create an "EQUAL WITH" matcher for the given group
compared with the group stored in the
EventMetaData . |
static BusMatcher |
isAssignableFrom(Class<?> aEventType)
Factory method to create an event matcher by event type.
|
static BusMatcher |
or(BusMatcher... aEventMatchers)
Factory method to create an "OR" matcher for the given matchers.
|
static <E extends BusEvent,PT> |
publisherIsAssignableFrom(Class<? extends PT> aPublisherType)
Factory method to create an event matcher by event publisher type.
|
static BusMatcher |
uidIdEqualWith(String aUid)
Factory method to create an "EQUAL WITH" matcher for the given UID
compared with the UID stored in the
EventMetaData . |
public static BusMatcher catchAll()
BusMatcher
.public static BusMatcher catchNone()
BusMatcher
.public static BusMatcher isAssignableFrom(Class<?> aEventType)
aEventType
- The event type to be matched by this matcher.public static <E extends BusEvent,PT> BusMatcher publisherIsAssignableFrom(Class<? extends PT> aPublisherType)
E
- the element typePT
- The publisher descriptor typeaPublisherType
- The event publisher type to be matched by this
matcher.@SafeVarargs public static BusMatcher or(BusMatcher... aEventMatchers)
aEventMatchers
- The matchers to be combined by an "OR".@SafeVarargs public static BusMatcher and(BusMatcher... aEventMatchers)
aEventMatchers
- The matchers to be combined by an "AND".public static BusMatcher aliasEqualWith(String aAlias)
EventMetaData
.aAlias
- The name to be compared with a
GenericMetaDataEvent
's EventMetaData
's name
property.GenericMetaDataEvent
's name property.public static BusMatcher groupEqualWith(String aGroup)
EventMetaData
.aGroup
- The group to be compared with a
GenericMetaDataEvent
's EventMetaData
's group
property.GenericMetaDataEvent
's group property.public static BusMatcher channelEqualWith(String aChannel)
EventMetaData
.aChannel
- The channel to be compared with a
GenericMetaDataEvent
's EventMetaData
's channel
property.GenericMetaDataEvent
's channel property.public static BusMatcher uidIdEqualWith(String aUid)
EventMetaData
.aUid
- The UID to be compared with a GenericMetaDataEvent
's
EventMetaData
's UID property.GenericMetaDataEvent
's UID property.public static <E extends BusEvent,A> BusMatcher actionEqualWith(A aAction)
EventMetaData
.E
- the element typeA
- The type of the action stored in the event. CAUTION: The
drawback of not using generic generic type declaration on a class
level is no granted type safety, the advantage is the ease of use:
Sub-classes can be used out of the box.aAction
- The action to be compared with a
GenericMetaDataEvent
's EventMetaData
's action
property.GenericActionEvent
's action property.Copyright © 2018. All rights reserved.