⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mockcondition.java

📁 drools 一个开放源码的规则引擎
💻 JAVA
字号:
package org.drools.spi;

import org.drools.rule.Declaration;

public class MockCondition
    implements
    Condition
{
    
    private Declaration[] declarations;
    private boolean       isAllowed;
    
    private boolean testException;
    
    public MockCondition(Declaration[] declarations,
                         boolean isAllowed)
    {
        this.declarations = declarations;
        this.isAllowed = isAllowed;
    }

    public Declaration[] getRequiredTupleMembers()
    {
        return this.declarations;
    }

    public boolean isAllowed(Tuple tuple) throws TestException
    {
        if ( this.testException )
        {
            throw new TestException();
        }
        return this.isAllowed;
    }
    
    public void setTestException( boolean testException )
    {
        this.testException = testException;
    }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -