in dubbo-admin-server/src/main/java/org/apache/dubbo/admin/model/store/mesh/virtualservice/match/StringMatch.java [70:92]
public static boolean isMatch(StringMatch stringMatch, String input) {
if (stringMatch.getExact() != null && input != null) {
if (input.equals(stringMatch.getExact())) {
return true;
}
} else if (stringMatch.getPrefix() != null && input != null) {
if (input.startsWith(stringMatch.getPrefix())) {
return true;
}
} else if (stringMatch.getRegex() != null && input != null) {
if (input.matches(stringMatch.getRegex())) {
return true;
}
} else if (stringMatch.getEmpty() != null) {
return input == null || "".equals(input);
} else if (stringMatch.getNoempty() != null) {
return input != null && input.length() > 0;
} else {
return false;
}
return false;
}