package com.xydl.cac.comparator;

import java.util.Date;
import java.util.LinkedHashMap;

/**
 * Created by hf
 * desc:  比较器，传入的值，和配置的值，进行比较，
 * true:  符合规则
 * false: 不符合规则
 */
public abstract class Comparator {
    protected String operator;
    protected long hours;

    public Comparator() {
    }

    // 比较
    public abstract boolean compare(Object source, String threshold, Date lastDTime);

    // 支持的比较符
    public abstract LinkedHashMap<String, String> supportedOperator();

    // 校验阈值
    public abstract void valid(String operator, String threshold) throws Exception;

    public String getOperator() {
        return operator;
    }

    public void setOperator(String operator) {
        this.operator = operator;
    }

    public long getHours() {
        return hours;
    }

    public void setHours(long hours) {
        this.hours = hours;
    }
}
