All Downloads are FREE. Search and download functionalities are using the official Maven repository.

pers.zr.opensource.magic.dao.matcher.Matcher Maven / Gradle / Ivy

There is a newer version: 1.0.1
Show newest version
package pers.zr.opensource.magic.dao.matcher;

import pers.zr.opensource.magic.dao.constants.MatchType;

/**
 * Created by zhurong on 2016-4-28.
 */
public abstract class Matcher {

    protected String column;

    public abstract MatchType getMatchType();

    public abstract Object[] getValues();

    public String getColumn() {
        return column;
    }

    protected String convertSpecialChar(String value, MatchType matchType) {
        String newValue = value;

        if(MatchType.LIKE == matchType) {
            newValue = newValue.replace("\\", "\\\\");
            newValue = newValue.replace("%", "\\%");
            newValue = newValue.replace("_", "\\_");
        }
        return newValue;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy