コード例 #1
0
 public void receive(Event event) {
   if (event.triggerType() == TriggerType.COLLECTING) {
     insertIntoRepository((CollectedEvent) event);
   } else {
     removeFromRepository(event);
   }
 }
コード例 #2
0
 private void removeFromRepository(Event event) {
   Element objectId = Element.of(event.source().id());
   if (storage.contains(objectId)) {
     storage.remove(objectId);
   }
 }