package cn.ey.biz.module.system.framework.rule;

import java.util.List;
import java.util.Map;

public class AndRule extends CompositeRule {

    public AndRule(List<Rule> rules){
        super(rules);
    }

    @Override
    public boolean evaluate(Map<String, Object> params) {
        if(rules == null){
            return true;
        }
        return rules.stream().allMatch(item -> item.evaluate(params));
    }

}