public class EventBusMatcherByDeclaration extends Object
Constructor and Description |
---|
EventBusMatcherByDeclaration() |
Modifier and Type | Method and Description |
---|---|
static <E extends org.refcodes.observer.events.MetaDataEvent,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 EventBusMatcher |
and(EventBusMatcher... aEventMatchers)
Factory method to create an "AND" matcher for the given matchers.
|
static EventBusMatcher |
groupEqualWith(String aGroup)
Factory method to create an "EQUAL WITH" matcher for the given group
compared with the group stored in the
EventMetaData . |
static EventBusMatcher |
isAssignableFrom(Class<?> aEventType)
Factory method to create an event matcher by event type.
|
static EventBusMatcher |
nameEqualWith(String aName)
Factory method to create an "EQUAL WITH" matcher for the given name
compared with the name stored in the
EventMetaData . |
static EventBusMatcher |
or(EventBusMatcher... aEventMatchers)
Factory method to create an "OR" matcher for the given matchers.
|
static <E extends org.refcodes.observer.events.MetaDataEvent,PT> |
publisherIsAssignableFrom(Class<? extends PT> aPublisherType)
Factory method to create an event matcher by event publisher type.
|
static EventBusMatcher |
universalIdEqualWith(String aUniversalId)
Factory method to create an "EQUAL WITH" matcher for the given UID
compared with the UID stored in the
EventMetaData . |
public static EventBusMatcher isAssignableFrom(Class<?> aEventType)
aEventType
- The event type to be matched by this matcher.public static <E extends org.refcodes.observer.events.MetaDataEvent,PT> EventBusMatcher publisherIsAssignableFrom(Class<? extends PT> aPublisherType)
MetaDataEvent
- The type of the event to be matchedPT
- The publisher descriptor typeaPublisherType
- The event publisher type to be matched by this
matcher.@SafeVarargs public static EventBusMatcher or(EventBusMatcher... aEventMatchers)
aEventMatchers
- The matchers to be combined by an "OR".@SafeVarargs public static EventBusMatcher and(EventBusMatcher... aEventMatchers)
MetaDataEvent
- The event type applied to the matcheraEventMatchers
- The matchers to be combined by an "AND".public static EventBusMatcher nameEqualWith(String aName)
EventMetaData
.MetaDataEvent
- The event type applied to the matcheraName
- The name to be compared with a MetaDataEvent
's
EventMetaData
's name property.MetaDataEvent
's
name property.public static EventBusMatcher groupEqualWith(String aGroup)
EventMetaData
.MetaDataEvent
- The event type applied to the matcheraGroup
- The group to be compared with a MetaDataEvent
's
EventMetaData
's group property.MetaDataEvent
's
group property.public static EventBusMatcher universalIdEqualWith(String aUniversalId)
EventMetaData
.MetaDataEvent
- The event type applied to the matcheraUniversalId
- The UID to be compared with a MetaDataEvent
's
EventMetaData
's UID property.MetaDataEvent
's UID
property.public static <E extends org.refcodes.observer.events.MetaDataEvent,A> EventBusMatcher actionEqualWith(A aAction)
EventMetaData
.MetaDataEvent
- The event type applied to the matcher.A
- 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 MetaDataEvent
's
EventMetaData
's action property.Event
's action
property.Copyright © 2015. All rights reserved.