|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.stuffthathappens.classbus.MatcherMaker
public class MatcherMaker
Static factory methods for creating Matcher objects. We recommend using static
imports for the most concise possible syntax:
EventService eventService = ... eventService.subscribe(exactChannel(myChannel), exactType(String.class), mySubscriber);
| Method Summary | ||
|---|---|---|
static Matcher<java.lang.String> |
anyChannel()
Create a matcher that accepts events sent to any channel. |
|
static Matcher<java.lang.String> |
exactChannel(java.lang.String matchOnChannel)
Create an exact matcher. |
|
static
|
exactType(java.lang.Class<T> matchOnType)
Create a matcher that matches when the eventClass is an exact match. |
|
static Matcher<java.lang.String> |
nullChannel()
Create the null channel matcher. |
|
static Matcher<java.lang.String> |
regexChannel(java.lang.String regex)
Create a matcher that accepts events sent to channels matching the given regular expression. |
|
static
|
subtype(java.lang.Class<T> matchOnType)
If you pass "Base" as the matchOnType, then events of type "Base" as well as "Derived" will be valid matches. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static Matcher<java.lang.String> exactChannel(java.lang.String matchOnChannel)
matchOnChannel - the channel name to match (exactly), or null to
only accept events sent to the null channel.
public static Matcher<java.lang.String> nullChannel()
public static Matcher<java.lang.String> anyChannel()
public static Matcher<java.lang.String> regexChannel(java.lang.String regex)
regex - a regular expression.
public static <T> Matcher<java.lang.Object> exactType(java.lang.Class<T> matchOnType)
matchOnType - the type of event.public static <T> Matcher<java.lang.Object> subtype(java.lang.Class<T> matchOnType)
matchOnType - the base class to match on, events matching this type
as well as subtypes of this class are considered matches.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||