001    package com.hammurapi.eventbus.tests;
002    
003    import com.hammurapi.common.Condition;
004    import com.hammurapi.eventbus.Handler;
005    import com.hammurapi.eventbus.tests.LocalEventBusTests.ObservableStringReference;
006    
007    public class HelperHandler_o {
008            
009            private int worldCounter;
010            private boolean worldOk;
011            
012            private int emCounter;
013            private boolean emOk;
014            
015            public int getWorldCounter() {
016                    return worldCounter;
017            }
018    
019            public boolean isWorldOk() {
020                    return worldOk;
021            }
022    
023            public int getEmCounter() {
024                    return emCounter;
025            }
026    
027            public boolean isEmOk() {
028                    return emOk;
029            }
030    
031            @Handler("java(str)://str.get().equals(\"World\")")
032            public void handleWorld(ObservableStringReference strRef) {
033                    ++worldCounter;
034                    worldOk = "World".equals(strRef.get());
035            }
036            
037            @Handler //("\"!\".equals(args[0])")
038            public void handleEm(@Condition("\"!\".equals(strRef.get())") ObservableStringReference strRef) {
039                    ++emCounter;
040                    emOk = "!".equals(strRef.get());
041            }
042    }