Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2015 JBoss Inc
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
 */
 
 package org.drools.impl.adapters;
 
 import  org.kie.api.event.rule.AfterMatchFiredEvent;
 import  org.kie.api.event.rule.AgendaGroupPoppedEvent;
 import  org.kie.api.event.rule.AgendaGroupPushedEvent;
 import  org.kie.api.event.rule.BeforeMatchFiredEvent;
 import  org.kie.api.event.rule.MatchCancelledEvent;
 import  org.kie.api.event.rule.MatchCreatedEvent;
 import  org.kie.api.event.rule.RuleFlowGroupActivatedEvent;
 import  org.kie.api.event.rule.RuleFlowGroupDeactivatedEvent;
 
 public class AgendaEventListenerAdapter implements org.kie.api.event.rule.AgendaEventListener {
 
     private final AgendaEventListener delegate;
 
     public AgendaEventListenerAdapter(AgendaEventListener delegate) {
         this. = delegate;
     }
 
     public void matchCreated(final MatchCreatedEvent event) {
             public Activation getActivation() {
                 return new ActivationAdapter(event.getMatch());
             }
 
             public KnowledgeRuntime getKnowledgeRuntime() {
                 return new KnowledgeRuntimeAdapter((org.kie.internal.runtime.KnowledgeRuntime) event.getKieRuntime());
             }
         });
     }
 
     public void matchCancelled(final MatchCancelledEvent event) {
             public ActivationCancelledCause getCause() {
                 switch (event.getCause()) {
                     case CLEAR:
                         return .;
                     case FILTER:
                         return .;
                     case WME_MODIFY:
                         return .;
                 }
                 return null;
             }
 
             public Activation getActivation() {
                 return new ActivationAdapter(event.getMatch());
             }
 
             public KnowledgeRuntime getKnowledgeRuntime() {
                 return new KnowledgeRuntimeAdapter((org.kie.internal.runtime.KnowledgeRuntime) event.getKieRuntime());
             }
         });
     }
 
     public void beforeMatchFired(final BeforeMatchFiredEvent event) {
             public Activation getActivation() {
                 return new ActivationAdapter(event.getMatch());
             }
 
             public KnowledgeRuntime getKnowledgeRuntime() {
                 return new KnowledgeRuntimeAdapter((org.kie.internal.runtime.KnowledgeRuntime) event.getKieRuntime());
             }
         });
     }
 
     public void afterMatchFired(final AfterMatchFiredEvent event) {
             public Activation getActivation() {
                 return new ActivationAdapter(event.getMatch());
             }
 
             public KnowledgeRuntime getKnowledgeRuntime() {
                return new KnowledgeRuntimeAdapter((org.kie.internal.runtime.KnowledgeRuntime) event.getKieRuntime());
            }
        });
    }
    public void agendaGroupPopped(final AgendaGroupPoppedEvent event) {
            public AgendaGroup getAgendaGroup() {
                return new AgendaGroupAdapter(event.getAgendaGroup());
            }
            public KnowledgeRuntime getKnowledgeRuntime() {
                return new KnowledgeRuntimeAdapter((org.kie.internal.runtime.KnowledgeRuntime) event.getKieRuntime());
            }
        });
    }
    public void agendaGroupPushed(final AgendaGroupPushedEvent event) {
            public AgendaGroup getAgendaGroup() {
                return new AgendaGroupAdapter(event.getAgendaGroup());
            }
            public KnowledgeRuntime getKnowledgeRuntime() {
                return new KnowledgeRuntimeAdapter((org.kie.internal.runtime.KnowledgeRuntime) event.getKieRuntime());
            }
        });
    }
    public void beforeRuleFlowGroupActivated(final RuleFlowGroupActivatedEvent event) {
            public RuleFlowGroup getRuleFlowGroup() {
                return new RuleFlowGroupAdapter(event.getRuleFlowGroup());
            }
            public KnowledgeRuntime getKnowledgeRuntime() {
                return new KnowledgeRuntimeAdapter((org.kie.internal.runtime.KnowledgeRuntime) event.getKieRuntime());
            }
        });
    }
    public void afterRuleFlowGroupActivated(final RuleFlowGroupActivatedEvent event) {
            public RuleFlowGroup getRuleFlowGroup() {
                return new RuleFlowGroupAdapter(event.getRuleFlowGroup());
            }
            public KnowledgeRuntime getKnowledgeRuntime() {
                return new KnowledgeRuntimeAdapter((org.kie.internal.runtime.KnowledgeRuntime) event.getKieRuntime());
            }
        });
    }
    public void beforeRuleFlowGroupDeactivated(final RuleFlowGroupDeactivatedEvent event) {
            public RuleFlowGroup getRuleFlowGroup() {
                return new RuleFlowGroupAdapter(event.getRuleFlowGroup());
            }
            public KnowledgeRuntime getKnowledgeRuntime() {
                return new KnowledgeRuntimeAdapter((org.kie.internal.runtime.KnowledgeRuntime) event.getKieRuntime());
            }
        });
    }
    public void afterRuleFlowGroupDeactivated(final RuleFlowGroupDeactivatedEvent event) {
            public RuleFlowGroup getRuleFlowGroup() {
                return new RuleFlowGroupAdapter(event.getRuleFlowGroup());
            }
            public KnowledgeRuntime getKnowledgeRuntime() {
                return new KnowledgeRuntimeAdapter((org.kie.internal.runtime.KnowledgeRuntime) event.getKieRuntime());
            }
        });
    }
    @Override
    public int hashCode() {
        return .hashCode();
    }
    @Override
    public boolean equals(Object obj) {
        return obj instanceof AgendaEventListenerAdapter && .equals(((AgendaEventListenerAdapter)obj).);
    }
New to GrepCode? Check out our FAQ X