org.mozilla.zest.core.v1.ZestExpressionURL.isInverse()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(1.8k)|赞(0)|评价(0)|浏览(66)

本文整理了Java中org.mozilla.zest.core.v1.ZestExpressionURL.isInverse()方法的一些代码示例,展示了ZestExpressionURL.isInverse()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZestExpressionURL.isInverse()方法的具体详情如下:
包路径:org.mozilla.zest.core.v1.ZestExpressionURL
类名称:ZestExpressionURL
方法名:isInverse

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));
  }
}

相关文章