package cn.com.victorysoft.business.analyze.service.condition;

import cn.com.victorysoft.business.analyze.constant.CstDataTypeEnum;

public class ConditionFactory {

    public static Condition get(CstDataTypeEnum dataType, String operator) {
        if (dataType == CstDataTypeEnum.DATE) {
            return new DateCondition();
        }else if (dataType == CstDataTypeEnum.DICT) {
            return new DictCondition();
        }else if (dataType == CstDataTypeEnum.NUMBER) {
            return new NumberCondition(operator);
        }else if (dataType == CstDataTypeEnum.VARCHAR) {
            return new VarcharCondition(operator);
        }else {
            return null;
        }
    }
}
