| 1 | package com.hammurapi.eventbus.tests.familyties.rules; |
| 2 | |
| 3 | import java.util.HashSet; |
| 4 | import java.util.Set; |
| 5 | |
| 6 | import com.hammurapi.eventbus.AbstractEventBus; |
| 7 | import com.hammurapi.eventbus.AbstractEventBus.Handle; |
| 8 | import com.hammurapi.eventbus.AbstractEventHandler; |
| 9 | import com.hammurapi.eventbus.EventDispatchContext; |
| 10 | import com.hammurapi.eventbus.EventHandler; |
| 11 | import com.hammurapi.eventbus.JavaBinder; |
| 12 | import com.hammurapi.extract.Predicate; |
| 13 | import com.hammurapi.eventbus.EventHandlerBase.Mode; |
| 14 | |
| 15 | /** |
| 16 | * Binds handler class com.hammurapi.eventbus.tests.familyties.rules.SecondaryRules to event bus com.hammurapi.eventbus.tests.familyties.FamilyTiesEventBus |
| 17 | */ |
| 18 | public class SecondaryRulesJavaBinder implements JavaBinder<com.hammurapi.eventbus.tests.familyties.model.Relative, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, java.lang.Long, com.hammurapi.eventbus.AbstractEventBus.Handle<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, java.lang.Long>, com.hammurapi.eventbus.tests.familyties.FamilyTiesEventStore, com.hammurapi.eventbus.tests.familyties.FamilyTiesEventBus, com.hammurapi.eventbus.tests.familyties.rules.SecondaryRules> { |
| 19 | |
| 20 | @Override |
| 21 | public Set<java.lang.Long> bind(com.hammurapi.eventbus.tests.familyties.rules.SecondaryRules instance, com.hammurapi.eventbus.tests.familyties.FamilyTiesEventBus bus) { |
| 22 | Set<java.lang.Long> ret = new HashSet<java.lang.Long>(); |
| 23 | |
| 24 | ret.add(infer(instance, bus)); |
| 25 | ret.add(infer0(instance, bus)); |
| 26 | ret.add(infer1(instance, bus)); |
| 27 | ret.add(infer2(instance, bus)); |
| 28 | ret.add(infer3(instance, bus)); |
| 29 | ret.add(infer4(instance, bus)); |
| 30 | ret.add(infer5(instance, bus)); |
| 31 | ret.add(infer6(instance, bus)); |
| 32 | ret.add(infer7(instance, bus)); |
| 33 | ret.add(infer8(instance, bus)); |
| 34 | |
| 35 | return ret; |
| 36 | } |
| 37 | |
| 38 | |
| 39 | private java.lang.Long infer(final com.hammurapi.eventbus.tests.familyties.rules.SecondaryRules instance, com.hammurapi.eventbus.tests.familyties.FamilyTiesEventBus bus) { |
| 40 | |
| 41 | Predicate<com.hammurapi.eventbus.tests.familyties.model.Relative, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules>[] predicates = new Predicate[2]; |
| 42 | |
| 43 | |
| 44 | predicates[0] = new com.hammurapi.extract.InstanceOfPredicate(new com.hammurapi.extract.IndexedExtractor(0), com.hammurapi.eventbus.tests.familyties.model.Sister.class); |
| 45 | |
| 46 | predicates[1] = new com.hammurapi.extract.InstanceOfPredicate(new com.hammurapi.extract.IndexedExtractor(1), com.hammurapi.eventbus.tests.familyties.model.Parent.class); |
| 47 | |
| 48 | EventHandler<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, com.hammurapi.eventbus.AbstractEventBus.Handle<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, java.lang.Long>, com.hammurapi.eventbus.tests.familyties.FamilyTiesEventStore> eventHandler = new AbstractEventHandler<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, com.hammurapi.eventbus.AbstractEventBus.Handle<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, java.lang.Long>, com.hammurapi.eventbus.tests.familyties.FamilyTiesEventStore>( |
| 49 | 2, |
| 50 | 0, |
| 51 | instance, |
| 52 | true, |
| 53 | false, |
| 54 | Mode.POST, |
| 55 | predicates) { |
| 56 | |
| 57 | @Override |
| 58 | public void post(EventDispatchContext<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, com.hammurapi.eventbus.AbstractEventBus.Handle<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, java.lang.Long>, com.hammurapi.eventbus.tests.familyties.FamilyTiesEventStore> context, com.hammurapi.eventbus.tests.familyties.model.Relative... events) { |
| 59 | com.hammurapi.eventbus.tests.familyties.model.Aunt toPost = instance.infer( |
| 60 | |
| 61 | (com.hammurapi.eventbus.tests.familyties.model.Sister) events[0], |
| 62 | (com.hammurapi.eventbus.tests.familyties.model.Parent) events[1] |
| 63 | ); |
| 64 | |
| 65 | |
| 66 | |
| 67 | if (com.hammurapi.eventbus.tests.familyties.model.Relative.class.isInstance(toPost)) { |
| 68 | context.post(toPost); |
| 69 | } |
| 70 | |
| 71 | } |
| 72 | |
| 73 | public String toString() { |
| 74 | return "Compiled event handler for method public com.hammurapi.eventbus.tests.familyties.model.Aunt com.hammurapi.eventbus.tests.familyties.rules.SecondaryRules.infer(com.hammurapi.eventbus.tests.familyties.model.Sister,com.hammurapi.eventbus.tests.familyties.model.Parent), cardinality="+getCardinality(); |
| 75 | } |
| 76 | |
| 77 | |
| 78 | }; |
| 79 | |
| 80 | return bus.addHandler(eventHandler); |
| 81 | } |
| 82 | |
| 83 | |
| 84 | private java.lang.Long infer0(final com.hammurapi.eventbus.tests.familyties.rules.SecondaryRules instance, com.hammurapi.eventbus.tests.familyties.FamilyTiesEventBus bus) { |
| 85 | |
| 86 | Predicate<com.hammurapi.eventbus.tests.familyties.model.Relative, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules>[] predicates = new Predicate[3]; |
| 87 | |
| 88 | |
| 89 | predicates[0] = new com.hammurapi.extract.InstanceOfPredicate(new com.hammurapi.extract.IndexedExtractor(0), com.hammurapi.eventbus.tests.familyties.model.Child.class); |
| 90 | |
| 91 | predicates[1] = new com.hammurapi.extract.InstanceOfPredicate(new com.hammurapi.extract.IndexedExtractor(1), com.hammurapi.eventbus.tests.familyties.model.Child.class); |
| 92 | |
| 93 | predicates[2] = new com.hammurapi.extract.InstanceOfPredicate(new com.hammurapi.extract.IndexedExtractor(2), com.hammurapi.eventbus.tests.familyties.model.Sibling.class); |
| 94 | |
| 95 | EventHandler<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, com.hammurapi.eventbus.AbstractEventBus.Handle<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, java.lang.Long>, com.hammurapi.eventbus.tests.familyties.FamilyTiesEventStore> eventHandler = new AbstractEventHandler<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, com.hammurapi.eventbus.AbstractEventBus.Handle<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, java.lang.Long>, com.hammurapi.eventbus.tests.familyties.FamilyTiesEventStore>( |
| 96 | 3, |
| 97 | 0, |
| 98 | instance, |
| 99 | true, |
| 100 | false, |
| 101 | Mode.POST, |
| 102 | predicates) { |
| 103 | |
| 104 | @Override |
| 105 | public void post(EventDispatchContext<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, com.hammurapi.eventbus.AbstractEventBus.Handle<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, java.lang.Long>, com.hammurapi.eventbus.tests.familyties.FamilyTiesEventStore> context, com.hammurapi.eventbus.tests.familyties.model.Relative... events) { |
| 106 | instance.infer( |
| 107 | |
| 108 | wrap(context), |
| 109 | |
| 110 | (com.hammurapi.eventbus.tests.familyties.model.Child) events[0], |
| 111 | (com.hammurapi.eventbus.tests.familyties.model.Child) events[1], |
| 112 | (com.hammurapi.eventbus.tests.familyties.model.Sibling) events[2] |
| 113 | ); |
| 114 | |
| 115 | |
| 116 | } |
| 117 | |
| 118 | public String toString() { |
| 119 | return "Compiled event handler for method public void com.hammurapi.eventbus.tests.familyties.rules.SecondaryRules.infer(com.hammurapi.eventbus.tests.familyties.FamilyTiesEventDispatchContext,com.hammurapi.eventbus.tests.familyties.model.Child,com.hammurapi.eventbus.tests.familyties.model.Child,com.hammurapi.eventbus.tests.familyties.model.Sibling), cardinality="+getCardinality(); |
| 120 | } |
| 121 | |
| 122 | |
| 123 | private com.hammurapi.eventbus.tests.familyties.FamilyTiesEventDispatchContext wrap(final EventDispatchContext<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, com.hammurapi.eventbus.AbstractEventBus.Handle<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, java.lang.Long>, com.hammurapi.eventbus.tests.familyties.FamilyTiesEventStore> context) { |
| 124 | return new com.hammurapi.eventbus.tests.familyties.FamilyTiesEventDispatchContext() { |
| 125 | |
| 126 | @Override |
| 127 | public void post(com.hammurapi.eventbus.tests.familyties.model.Relative event, Predicate<com.hammurapi.eventbus.tests.familyties.model.Relative, com.hammurapi.eventbus.tests.familyties.FamilyTiesEventStore>... validators) { |
| 128 | context.post(event, validators); |
| 129 | } |
| 130 | |
| 131 | @Override |
| 132 | public com.hammurapi.eventbus.EventHandlerBase.Mode getMode() { |
| 133 | return context.getMode(); |
| 134 | } |
| 135 | @Override |
| 136 | public void consume(int index) { |
| 137 | context.consume(index); |
| 138 | } |
| 139 | |
| 140 | @Override |
| 141 | public void consume(com.hammurapi.eventbus.tests.familyties.model.Relative event) { |
| 142 | context.consume(event); |
| 143 | } |
| 144 | |
| 145 | @Override |
| 146 | public void update(com.hammurapi.eventbus.tests.familyties.model.Relative event) { |
| 147 | context.update(event); |
| 148 | } |
| 149 | |
| 150 | @Override |
| 151 | public void removeHandler() { |
| 152 | context.removeHandler(); |
| 153 | } |
| 154 | |
| 155 | @Override |
| 156 | public com.hammurapi.eventbus.tests.familyties.FamilyTiesEventStore getEventStore() { |
| 157 | return context.getEventStore(); |
| 158 | } |
| 159 | |
| 160 | |
| 161 | }; |
| 162 | } |
| 163 | |
| 164 | }; |
| 165 | |
| 166 | return bus.addHandler(eventHandler); |
| 167 | } |
| 168 | |
| 169 | |
| 170 | private java.lang.Long infer1(final com.hammurapi.eventbus.tests.familyties.rules.SecondaryRules instance, com.hammurapi.eventbus.tests.familyties.FamilyTiesEventBus bus) { |
| 171 | |
| 172 | Predicate<com.hammurapi.eventbus.tests.familyties.model.Relative, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules>[] predicates = new Predicate[1]; |
| 173 | |
| 174 | |
| 175 | predicates[0] = new com.hammurapi.extract.InstanceOfPredicate(new com.hammurapi.extract.IndexedExtractor(0), com.hammurapi.eventbus.tests.familyties.model.Cousin.class); |
| 176 | |
| 177 | EventHandler<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, com.hammurapi.eventbus.AbstractEventBus.Handle<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, java.lang.Long>, com.hammurapi.eventbus.tests.familyties.FamilyTiesEventStore> eventHandler = new AbstractEventHandler<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, com.hammurapi.eventbus.AbstractEventBus.Handle<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, java.lang.Long>, com.hammurapi.eventbus.tests.familyties.FamilyTiesEventStore>( |
| 178 | 1, |
| 179 | 0, |
| 180 | instance, |
| 181 | true, |
| 182 | false, |
| 183 | Mode.POST, |
| 184 | predicates) { |
| 185 | |
| 186 | @Override |
| 187 | public void post(EventDispatchContext<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, com.hammurapi.eventbus.AbstractEventBus.Handle<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, java.lang.Long>, com.hammurapi.eventbus.tests.familyties.FamilyTiesEventStore> context, com.hammurapi.eventbus.tests.familyties.model.Relative... events) { |
| 188 | com.hammurapi.eventbus.tests.familyties.model.Cousin toPost = instance.infer( |
| 189 | |
| 190 | (com.hammurapi.eventbus.tests.familyties.model.Cousin) events[0] |
| 191 | ); |
| 192 | |
| 193 | |
| 194 | |
| 195 | if (com.hammurapi.eventbus.tests.familyties.model.Relative.class.isInstance(toPost)) { |
| 196 | context.post(toPost); |
| 197 | } |
| 198 | |
| 199 | } |
| 200 | |
| 201 | public String toString() { |
| 202 | return "Compiled event handler for method public com.hammurapi.eventbus.tests.familyties.model.Cousin com.hammurapi.eventbus.tests.familyties.rules.SecondaryRules.infer(com.hammurapi.eventbus.tests.familyties.model.Cousin), cardinality="+getCardinality(); |
| 203 | } |
| 204 | |
| 205 | |
| 206 | }; |
| 207 | |
| 208 | return bus.addHandler(eventHandler); |
| 209 | } |
| 210 | |
| 211 | |
| 212 | private java.lang.Long infer2(final com.hammurapi.eventbus.tests.familyties.rules.SecondaryRules instance, com.hammurapi.eventbus.tests.familyties.FamilyTiesEventBus bus) { |
| 213 | |
| 214 | Predicate<com.hammurapi.eventbus.tests.familyties.model.Relative, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules>[] predicates = new Predicate[1]; |
| 215 | |
| 216 | |
| 217 | predicates[0] = new com.hammurapi.extract.And(0, null, new com.hammurapi.extract.CommutativeAnd(0, null, new com.hammurapi.extract.InstanceOfPredicate(new com.hammurapi.extract.IndexedExtractor(0), com.hammurapi.eventbus.tests.familyties.model.Aunt.class), new com.hammurapi.extract.InstanceOfPredicate(new com.hammurapi.extract.IndexedExtractor(1), com.hammurapi.eventbus.tests.familyties.model.Parent.class)), new com.hammurapi.extract.Equal(0, null, new Extractor64(null), new Extractor65(null), false)); |
| 218 | |
| 219 | EventHandler<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, com.hammurapi.eventbus.AbstractEventBus.Handle<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, java.lang.Long>, com.hammurapi.eventbus.tests.familyties.FamilyTiesEventStore> eventHandler = new AbstractEventHandler<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, com.hammurapi.eventbus.AbstractEventBus.Handle<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, java.lang.Long>, com.hammurapi.eventbus.tests.familyties.FamilyTiesEventStore>( |
| 220 | 2, |
| 221 | 0, |
| 222 | instance, |
| 223 | true, |
| 224 | false, |
| 225 | Mode.POST, |
| 226 | predicates) { |
| 227 | |
| 228 | @Override |
| 229 | public void post(EventDispatchContext<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, com.hammurapi.eventbus.AbstractEventBus.Handle<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, java.lang.Long>, com.hammurapi.eventbus.tests.familyties.FamilyTiesEventStore> context, com.hammurapi.eventbus.tests.familyties.model.Relative... events) { |
| 230 | com.hammurapi.eventbus.tests.familyties.model.Cousin toPost = instance.infer( |
| 231 | |
| 232 | (com.hammurapi.eventbus.tests.familyties.model.Aunt) events[0], |
| 233 | (com.hammurapi.eventbus.tests.familyties.model.Parent) events[1] |
| 234 | ); |
| 235 | |
| 236 | |
| 237 | |
| 238 | if (com.hammurapi.eventbus.tests.familyties.model.Relative.class.isInstance(toPost)) { |
| 239 | context.post(toPost); |
| 240 | } |
| 241 | |
| 242 | } |
| 243 | |
| 244 | public String toString() { |
| 245 | return "Compiled event handler for method public com.hammurapi.eventbus.tests.familyties.model.Cousin com.hammurapi.eventbus.tests.familyties.rules.SecondaryRules.infer(com.hammurapi.eventbus.tests.familyties.model.Aunt,com.hammurapi.eventbus.tests.familyties.model.Parent), cardinality="+getCardinality(); |
| 246 | } |
| 247 | |
| 248 | |
| 249 | }; |
| 250 | |
| 251 | return bus.addHandler(eventHandler); |
| 252 | } |
| 253 | |
| 254 | |
| 255 | private java.lang.Long infer3(final com.hammurapi.eventbus.tests.familyties.rules.SecondaryRules instance, com.hammurapi.eventbus.tests.familyties.FamilyTiesEventBus bus) { |
| 256 | |
| 257 | Predicate<com.hammurapi.eventbus.tests.familyties.model.Relative, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules>[] predicates = new Predicate[2]; |
| 258 | |
| 259 | |
| 260 | predicates[0] = new com.hammurapi.extract.InstanceOfPredicate(new com.hammurapi.extract.IndexedExtractor(0), com.hammurapi.eventbus.tests.familyties.model.Uncle.class); |
| 261 | |
| 262 | predicates[1] = new com.hammurapi.extract.InstanceOfPredicate(new com.hammurapi.extract.IndexedExtractor(1), com.hammurapi.eventbus.tests.familyties.model.Parent.class); |
| 263 | |
| 264 | EventHandler<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, com.hammurapi.eventbus.AbstractEventBus.Handle<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, java.lang.Long>, com.hammurapi.eventbus.tests.familyties.FamilyTiesEventStore> eventHandler = new AbstractEventHandler<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, com.hammurapi.eventbus.AbstractEventBus.Handle<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, java.lang.Long>, com.hammurapi.eventbus.tests.familyties.FamilyTiesEventStore>( |
| 265 | 2, |
| 266 | 0, |
| 267 | instance, |
| 268 | true, |
| 269 | false, |
| 270 | Mode.POST, |
| 271 | predicates) { |
| 272 | |
| 273 | @Override |
| 274 | public void post(EventDispatchContext<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, com.hammurapi.eventbus.AbstractEventBus.Handle<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, java.lang.Long>, com.hammurapi.eventbus.tests.familyties.FamilyTiesEventStore> context, com.hammurapi.eventbus.tests.familyties.model.Relative... events) { |
| 275 | com.hammurapi.eventbus.tests.familyties.model.Cousin toPost = instance.infer( |
| 276 | |
| 277 | (com.hammurapi.eventbus.tests.familyties.model.Uncle) events[0], |
| 278 | (com.hammurapi.eventbus.tests.familyties.model.Parent) events[1] |
| 279 | ); |
| 280 | |
| 281 | |
| 282 | |
| 283 | if (com.hammurapi.eventbus.tests.familyties.model.Relative.class.isInstance(toPost)) { |
| 284 | context.post(toPost); |
| 285 | } |
| 286 | |
| 287 | } |
| 288 | |
| 289 | public String toString() { |
| 290 | return "Compiled event handler for method public com.hammurapi.eventbus.tests.familyties.model.Cousin com.hammurapi.eventbus.tests.familyties.rules.SecondaryRules.infer(com.hammurapi.eventbus.tests.familyties.model.Uncle,com.hammurapi.eventbus.tests.familyties.model.Parent), cardinality="+getCardinality(); |
| 291 | } |
| 292 | |
| 293 | |
| 294 | }; |
| 295 | |
| 296 | return bus.addHandler(eventHandler); |
| 297 | } |
| 298 | |
| 299 | |
| 300 | private java.lang.Long infer4(final com.hammurapi.eventbus.tests.familyties.rules.SecondaryRules instance, com.hammurapi.eventbus.tests.familyties.FamilyTiesEventBus bus) { |
| 301 | |
| 302 | Predicate<com.hammurapi.eventbus.tests.familyties.model.Relative, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules>[] predicates = new Predicate[1]; |
| 303 | |
| 304 | |
| 305 | predicates[0] = new com.hammurapi.extract.And(0, null, new com.hammurapi.extract.CommutativeAnd(0, null, new com.hammurapi.extract.InstanceOfPredicate(new com.hammurapi.extract.IndexedExtractor(0), com.hammurapi.eventbus.tests.familyties.model.Son.class), new com.hammurapi.extract.InstanceOfPredicate(new com.hammurapi.extract.IndexedExtractor(1), com.hammurapi.eventbus.tests.familyties.model.Sibling.class)), new com.hammurapi.extract.Equal(0, null, new Extractor58(null), new Extractor66(null), false)); |
| 306 | |
| 307 | EventHandler<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, com.hammurapi.eventbus.AbstractEventBus.Handle<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, java.lang.Long>, com.hammurapi.eventbus.tests.familyties.FamilyTiesEventStore> eventHandler = new AbstractEventHandler<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, com.hammurapi.eventbus.AbstractEventBus.Handle<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, java.lang.Long>, com.hammurapi.eventbus.tests.familyties.FamilyTiesEventStore>( |
| 308 | 2, |
| 309 | 0, |
| 310 | instance, |
| 311 | true, |
| 312 | false, |
| 313 | Mode.POST, |
| 314 | predicates) { |
| 315 | |
| 316 | @Override |
| 317 | public void post(EventDispatchContext<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, com.hammurapi.eventbus.AbstractEventBus.Handle<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, java.lang.Long>, com.hammurapi.eventbus.tests.familyties.FamilyTiesEventStore> context, com.hammurapi.eventbus.tests.familyties.model.Relative... events) { |
| 318 | com.hammurapi.eventbus.tests.familyties.model.Nephew toPost = instance.infer( |
| 319 | |
| 320 | (com.hammurapi.eventbus.tests.familyties.model.Son) events[0], |
| 321 | (com.hammurapi.eventbus.tests.familyties.model.Sibling) events[1] |
| 322 | ); |
| 323 | |
| 324 | |
| 325 | |
| 326 | if (com.hammurapi.eventbus.tests.familyties.model.Relative.class.isInstance(toPost)) { |
| 327 | context.post(toPost); |
| 328 | } |
| 329 | |
| 330 | } |
| 331 | |
| 332 | public String toString() { |
| 333 | return "Compiled event handler for method public com.hammurapi.eventbus.tests.familyties.model.Nephew com.hammurapi.eventbus.tests.familyties.rules.SecondaryRules.infer(com.hammurapi.eventbus.tests.familyties.model.Son,com.hammurapi.eventbus.tests.familyties.model.Sibling), cardinality="+getCardinality(); |
| 334 | } |
| 335 | |
| 336 | |
| 337 | }; |
| 338 | |
| 339 | return bus.addHandler(eventHandler); |
| 340 | } |
| 341 | |
| 342 | |
| 343 | private java.lang.Long infer5(final com.hammurapi.eventbus.tests.familyties.rules.SecondaryRules instance, com.hammurapi.eventbus.tests.familyties.FamilyTiesEventBus bus) { |
| 344 | |
| 345 | Predicate<com.hammurapi.eventbus.tests.familyties.model.Relative, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules>[] predicates = new Predicate[2]; |
| 346 | |
| 347 | |
| 348 | predicates[0] = new com.hammurapi.extract.InstanceOfPredicate(new com.hammurapi.extract.IndexedExtractor(0), com.hammurapi.eventbus.tests.familyties.model.Wife.class); |
| 349 | |
| 350 | predicates[1] = new com.hammurapi.extract.InstanceOfPredicate(new com.hammurapi.extract.IndexedExtractor(1), com.hammurapi.eventbus.tests.familyties.model.Uncle.class); |
| 351 | |
| 352 | EventHandler<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, com.hammurapi.eventbus.AbstractEventBus.Handle<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, java.lang.Long>, com.hammurapi.eventbus.tests.familyties.FamilyTiesEventStore> eventHandler = new AbstractEventHandler<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, com.hammurapi.eventbus.AbstractEventBus.Handle<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, java.lang.Long>, com.hammurapi.eventbus.tests.familyties.FamilyTiesEventStore>( |
| 353 | 2, |
| 354 | 0, |
| 355 | instance, |
| 356 | true, |
| 357 | false, |
| 358 | Mode.POST, |
| 359 | predicates) { |
| 360 | |
| 361 | @Override |
| 362 | public void post(EventDispatchContext<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, com.hammurapi.eventbus.AbstractEventBus.Handle<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, java.lang.Long>, com.hammurapi.eventbus.tests.familyties.FamilyTiesEventStore> context, com.hammurapi.eventbus.tests.familyties.model.Relative... events) { |
| 363 | com.hammurapi.eventbus.tests.familyties.model.Aunt toPost = instance.infer( |
| 364 | |
| 365 | (com.hammurapi.eventbus.tests.familyties.model.Wife) events[0], |
| 366 | (com.hammurapi.eventbus.tests.familyties.model.Uncle) events[1] |
| 367 | ); |
| 368 | |
| 369 | |
| 370 | |
| 371 | if (com.hammurapi.eventbus.tests.familyties.model.Relative.class.isInstance(toPost)) { |
| 372 | context.post(toPost); |
| 373 | } |
| 374 | |
| 375 | } |
| 376 | |
| 377 | public String toString() { |
| 378 | return "Compiled event handler for method public com.hammurapi.eventbus.tests.familyties.model.Aunt com.hammurapi.eventbus.tests.familyties.rules.SecondaryRules.infer(com.hammurapi.eventbus.tests.familyties.model.Wife,com.hammurapi.eventbus.tests.familyties.model.Uncle), cardinality="+getCardinality(); |
| 379 | } |
| 380 | |
| 381 | |
| 382 | }; |
| 383 | |
| 384 | return bus.addHandler(eventHandler); |
| 385 | } |
| 386 | |
| 387 | |
| 388 | private java.lang.Long infer6(final com.hammurapi.eventbus.tests.familyties.rules.SecondaryRules instance, com.hammurapi.eventbus.tests.familyties.FamilyTiesEventBus bus) { |
| 389 | |
| 390 | Predicate<com.hammurapi.eventbus.tests.familyties.model.Relative, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules>[] predicates = new Predicate[2]; |
| 391 | |
| 392 | |
| 393 | predicates[0] = new com.hammurapi.extract.InstanceOfPredicate(new com.hammurapi.extract.IndexedExtractor(0), com.hammurapi.eventbus.tests.familyties.model.Brother.class); |
| 394 | |
| 395 | predicates[1] = new com.hammurapi.extract.InstanceOfPredicate(new com.hammurapi.extract.IndexedExtractor(1), com.hammurapi.eventbus.tests.familyties.model.Parent.class); |
| 396 | |
| 397 | EventHandler<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, com.hammurapi.eventbus.AbstractEventBus.Handle<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, java.lang.Long>, com.hammurapi.eventbus.tests.familyties.FamilyTiesEventStore> eventHandler = new AbstractEventHandler<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, com.hammurapi.eventbus.AbstractEventBus.Handle<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, java.lang.Long>, com.hammurapi.eventbus.tests.familyties.FamilyTiesEventStore>( |
| 398 | 2, |
| 399 | 0, |
| 400 | instance, |
| 401 | true, |
| 402 | false, |
| 403 | Mode.POST, |
| 404 | predicates) { |
| 405 | |
| 406 | @Override |
| 407 | public void post(EventDispatchContext<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, com.hammurapi.eventbus.AbstractEventBus.Handle<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, java.lang.Long>, com.hammurapi.eventbus.tests.familyties.FamilyTiesEventStore> context, com.hammurapi.eventbus.tests.familyties.model.Relative... events) { |
| 408 | com.hammurapi.eventbus.tests.familyties.model.Uncle toPost = instance.infer( |
| 409 | |
| 410 | (com.hammurapi.eventbus.tests.familyties.model.Brother) events[0], |
| 411 | (com.hammurapi.eventbus.tests.familyties.model.Parent) events[1] |
| 412 | ); |
| 413 | |
| 414 | |
| 415 | |
| 416 | if (com.hammurapi.eventbus.tests.familyties.model.Relative.class.isInstance(toPost)) { |
| 417 | context.post(toPost); |
| 418 | } |
| 419 | |
| 420 | } |
| 421 | |
| 422 | public String toString() { |
| 423 | return "Compiled event handler for method public com.hammurapi.eventbus.tests.familyties.model.Uncle com.hammurapi.eventbus.tests.familyties.rules.SecondaryRules.infer(com.hammurapi.eventbus.tests.familyties.model.Brother,com.hammurapi.eventbus.tests.familyties.model.Parent), cardinality="+getCardinality(); |
| 424 | } |
| 425 | |
| 426 | |
| 427 | }; |
| 428 | |
| 429 | return bus.addHandler(eventHandler); |
| 430 | } |
| 431 | |
| 432 | |
| 433 | private java.lang.Long infer7(final com.hammurapi.eventbus.tests.familyties.rules.SecondaryRules instance, com.hammurapi.eventbus.tests.familyties.FamilyTiesEventBus bus) { |
| 434 | |
| 435 | Predicate<com.hammurapi.eventbus.tests.familyties.model.Relative, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules>[] predicates = new Predicate[2]; |
| 436 | |
| 437 | |
| 438 | predicates[0] = new com.hammurapi.extract.InstanceOfPredicate(new com.hammurapi.extract.IndexedExtractor(0), com.hammurapi.eventbus.tests.familyties.model.Husband.class); |
| 439 | |
| 440 | predicates[1] = new com.hammurapi.extract.InstanceOfPredicate(new com.hammurapi.extract.IndexedExtractor(1), com.hammurapi.eventbus.tests.familyties.model.Aunt.class); |
| 441 | |
| 442 | EventHandler<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, com.hammurapi.eventbus.AbstractEventBus.Handle<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, java.lang.Long>, com.hammurapi.eventbus.tests.familyties.FamilyTiesEventStore> eventHandler = new AbstractEventHandler<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, com.hammurapi.eventbus.AbstractEventBus.Handle<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, java.lang.Long>, com.hammurapi.eventbus.tests.familyties.FamilyTiesEventStore>( |
| 443 | 2, |
| 444 | 0, |
| 445 | instance, |
| 446 | true, |
| 447 | false, |
| 448 | Mode.POST, |
| 449 | predicates) { |
| 450 | |
| 451 | @Override |
| 452 | public void post(EventDispatchContext<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, com.hammurapi.eventbus.AbstractEventBus.Handle<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, java.lang.Long>, com.hammurapi.eventbus.tests.familyties.FamilyTiesEventStore> context, com.hammurapi.eventbus.tests.familyties.model.Relative... events) { |
| 453 | com.hammurapi.eventbus.tests.familyties.model.Uncle toPost = instance.infer( |
| 454 | |
| 455 | (com.hammurapi.eventbus.tests.familyties.model.Husband) events[0], |
| 456 | (com.hammurapi.eventbus.tests.familyties.model.Aunt) events[1] |
| 457 | ); |
| 458 | |
| 459 | |
| 460 | |
| 461 | if (com.hammurapi.eventbus.tests.familyties.model.Relative.class.isInstance(toPost)) { |
| 462 | context.post(toPost); |
| 463 | } |
| 464 | |
| 465 | } |
| 466 | |
| 467 | public String toString() { |
| 468 | return "Compiled event handler for method public com.hammurapi.eventbus.tests.familyties.model.Uncle com.hammurapi.eventbus.tests.familyties.rules.SecondaryRules.infer(com.hammurapi.eventbus.tests.familyties.model.Husband,com.hammurapi.eventbus.tests.familyties.model.Aunt), cardinality="+getCardinality(); |
| 469 | } |
| 470 | |
| 471 | |
| 472 | }; |
| 473 | |
| 474 | return bus.addHandler(eventHandler); |
| 475 | } |
| 476 | |
| 477 | |
| 478 | private java.lang.Long infer8(final com.hammurapi.eventbus.tests.familyties.rules.SecondaryRules instance, com.hammurapi.eventbus.tests.familyties.FamilyTiesEventBus bus) { |
| 479 | |
| 480 | Predicate<com.hammurapi.eventbus.tests.familyties.model.Relative, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules>[] predicates = new Predicate[1]; |
| 481 | |
| 482 | |
| 483 | predicates[0] = new com.hammurapi.extract.And(0, null, new com.hammurapi.extract.CommutativeAnd(0, null, new com.hammurapi.extract.InstanceOfPredicate(new com.hammurapi.extract.IndexedExtractor(0), com.hammurapi.eventbus.tests.familyties.model.Daughter.class), new com.hammurapi.extract.InstanceOfPredicate(new com.hammurapi.extract.IndexedExtractor(1), com.hammurapi.eventbus.tests.familyties.model.Sibling.class)), new com.hammurapi.extract.Equal(0, null, new Extractor60(null), new Extractor66(null), false)); |
| 484 | |
| 485 | EventHandler<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, com.hammurapi.eventbus.AbstractEventBus.Handle<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, java.lang.Long>, com.hammurapi.eventbus.tests.familyties.FamilyTiesEventStore> eventHandler = new AbstractEventHandler<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, com.hammurapi.eventbus.AbstractEventBus.Handle<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, java.lang.Long>, com.hammurapi.eventbus.tests.familyties.FamilyTiesEventStore>( |
| 486 | 2, |
| 487 | 0, |
| 488 | instance, |
| 489 | true, |
| 490 | false, |
| 491 | Mode.POST, |
| 492 | predicates) { |
| 493 | |
| 494 | @Override |
| 495 | public void post(EventDispatchContext<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, com.hammurapi.eventbus.AbstractEventBus.Handle<com.hammurapi.eventbus.tests.familyties.model.Relative, java.lang.Integer, com.hammurapi.eventbus.tests.familyties.rules.FamilyTiesRules, java.lang.Long>, com.hammurapi.eventbus.tests.familyties.FamilyTiesEventStore> context, com.hammurapi.eventbus.tests.familyties.model.Relative... events) { |
| 496 | com.hammurapi.eventbus.tests.familyties.model.Niece toPost = instance.infer( |
| 497 | |
| 498 | (com.hammurapi.eventbus.tests.familyties.model.Daughter) events[0], |
| 499 | (com.hammurapi.eventbus.tests.familyties.model.Sibling) events[1] |
| 500 | ); |
| 501 | |
| 502 | |
| 503 | |
| 504 | if (com.hammurapi.eventbus.tests.familyties.model.Relative.class.isInstance(toPost)) { |
| 505 | context.post(toPost); |
| 506 | } |
| 507 | |
| 508 | } |
| 509 | |
| 510 | public String toString() { |
| 511 | return "Compiled event handler for method public com.hammurapi.eventbus.tests.familyties.model.Niece com.hammurapi.eventbus.tests.familyties.rules.SecondaryRules.infer(com.hammurapi.eventbus.tests.familyties.model.Daughter,com.hammurapi.eventbus.tests.familyties.model.Sibling), cardinality="+getCardinality(); |
| 512 | } |
| 513 | |
| 514 | |
| 515 | }; |
| 516 | |
| 517 | return bus.addHandler(eventHandler); |
| 518 | } |
| 519 | |
| 520 | |
| 521 | } |