package com.jay.monitor.data.server.report.alert.rule.config;

import com.jay.monitor.data.server.enums.MatchRuleEnums;
import com.jay.monitor.data.server.report.alert.rule.MatchValueCondition;
import org.springframework.stereotype.Component;

/**
 * 等于匹配
 *
 * @author liukaixiong
 * @Email liukx@elab-plus.com
 * @date 2021/9/6 - 15:09
 */
@Component
public class EQValueCondition implements MatchValueCondition {

    @Override
    public MatchRuleEnums matchRule() {
        return MatchRuleEnums.eq;
    }

    @Override
    public boolean match(Object value, String matchValue) {

        if (value.toString().equals(matchValue)) {
            return true;
        }

        return false;
    }
}
