1 | package com.hammurapi.eventbus.tests; |
2 | |
3 | import com.hammurapi.common.Condition; |
4 | import com.hammurapi.eventbus.Handler; |
5 | import com.hammurapi.eventbus.tests.LocalEventBusTests.ObservableStringReference; |
6 | |
7 | public class HelperHandler_o { |
8 | |
9 | private int worldCounter; |
10 | private boolean worldOk; |
11 | |
12 | private int emCounter; |
13 | private boolean emOk; |
14 | |
15 | public int getWorldCounter() { |
16 | return worldCounter; |
17 | } |
18 | |
19 | public boolean isWorldOk() { |
20 | return worldOk; |
21 | } |
22 | |
23 | public int getEmCounter() { |
24 | return emCounter; |
25 | } |
26 | |
27 | public boolean isEmOk() { |
28 | return emOk; |
29 | } |
30 | |
31 | @Handler("java(str)://str.get().equals(\"World\")") |
32 | public void handleWorld(ObservableStringReference strRef) { |
33 | ++worldCounter; |
34 | worldOk = "World".equals(strRef.get()); |
35 | } |
36 | |
37 | @Handler //("\"!\".equals(args[0])") |
38 | public void handleEm(@Condition("\"!\".equals(strRef.get())") ObservableStringReference strRef) { |
39 | ++emCounter; |
40 | emOk = "!".equals(strRef.get()); |
41 | } |
42 | } |