本文整理了Java中org.mozilla.zest.core.v1.ZestExpressionURL.isInverse()
方法的一些代码示例,展示了ZestExpressionURL.isInverse()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZestExpressionURL.isInverse()
方法的具体详情如下:
包路径:org.mozilla.zest.core.v1.ZestExpressionURL
类名称:ZestExpressionURL
方法名:isInverse
暂无
代码示例来源:origin: mozilla/zest
@Override
public String toString() {
StringBuilder expression = new StringBuilder(150);
if (isInverse()) {
expression.append("NOT ");
}
expression.append("URL: ACCEPT:");
for (String s : includeRegexes) {
expression.append(' ').append(s);
}
expression.append(", EXCLUDE:");
for (String s : excludeRegexes) {
expression.append(' ').append(s);
}
return expression.toString();
}
}
代码示例来源:origin: mozilla/zest
@Override
public ZestExpressionURL deepCopy() {
ZestExpressionURL copy = new ZestExpressionURL();
List<String> copyIncludeRegex = new ArrayList<>(includeRegexes);
List<String> copyExcludeRegex = new ArrayList<>(excludeRegexes);
copy.setIncludeRegexes(copyIncludeRegex);
copy.setExcludeRegexes(copyExcludeRegex);
copy.setInverse(isInverse());
return copy;
}
代码示例来源:origin: mozilla/zest
@Test
public void testDeepCopy() {
ZestExpressionURL urlExpr = new ZestExpressionURL(includeStrings, excludeStrings);
urlExpr.setInverse(true);
ZestExpressionURL copy = urlExpr.deepCopy();
assertEquals(copy.isInverse(), urlExpr.isInverse());
for (int i = 0; i < includeSize; i++) {
String obtained = copy.getIncludeRegexes().get(i);
String expected = includeStrings.get(i);
String msg = "INCLUDE: expected " + expected + " instead of " + obtained;
assertTrue(msg, expected.equals(obtained));
}
for (int i = 0; i < excludeSize; i++) {
String obtained = copy.getExcludeRegexes().get(i);
String expected = excludeStrings.get(i);
String msg = "EXCLUDE: expected " + expected + " instead of " + obtained;
assertTrue(msg, expected.equals(obtained));
}
}
内容来源于网络,如有侵权,请联系作者删除!