001    package com.hammurapi.eventbus.tests;
002    
003    import com.hammurapi.common.Condition;
004    import com.hammurapi.eventbus.Handler;
005    
006    public class PredicateChainingHandler {
007            
008            private boolean oneInvoked;
009            private boolean twoInvoked;
010                    
011            @Handler
012            public void handleOne(@Condition("java(*)://str.length()>10 && str.startsWith(\"Hello\")") String str) {
013                    oneInvoked = true;
014            }
015            
016            @Handler("java(*)://AND(str.length()>10, str.endsWith(\"world!\"))")
017            public void handleTwo(String str) {
018                    twoInvoked = true;
019            }
020    
021            public boolean isOneInvoked() {
022                    return oneInvoked;
023            }
024            
025            public boolean isTwoInvoked() {
026                    return twoInvoked;
027            }
028            
029    }