org.onetwo.common.spring.match.RuleMatcher Maven / Gradle / Ivy
package org.onetwo.common.spring.match;
import java.util.List;
import org.onetwo.common.utils.LangUtils;
/**
* @author weishao zeng
*
*/
public class RuleMatcher {
private List value;
private MatchRules rule = MatchRules.CONTAINS;
public boolean match(String text) {
if (LangUtils.isEmpty(value)) {
return false;
}
return value.stream().anyMatch(v -> {
return rule.match(text, v);
});
}
public void setValue(List value) {
this.value = value;
}
public void setRule(MatchRules rule) {
this.rule = rule;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy