当前位置: 首页>>代码示例>>Java>>正文


Java CollectionUtils.assertSameElementsOrIllegalArgument方法代码示例

本文整理汇总了Java中com.bbn.bue.common.collections.CollectionUtils.assertSameElementsOrIllegalArgument方法的典型用法代码示例。如果您正苦于以下问题:Java CollectionUtils.assertSameElementsOrIllegalArgument方法的具体用法?Java CollectionUtils.assertSameElementsOrIllegalArgument怎么用?Java CollectionUtils.assertSameElementsOrIllegalArgument使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.bbn.bue.common.collections.CollectionUtils的用法示例。


在下文中一共展示了CollectionUtils.assertSameElementsOrIllegalArgument方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: checkValidity

import com.bbn.bue.common.collections.CollectionUtils; //导入方法依赖的package包/类
@Value.Check
protected void checkValidity() {
  // no incomplete response may appear in any response set
  final ImmutableSet<Response> allResponsesInSets = ImmutableSet.copyOf(
      concat(responseSets()));
  for (final Response incompleteResponse : incompleteResponses()) {
    checkArgument(!allResponsesInSets.contains(incompleteResponse),
        "A response may not be both completed and incomplete");
  }
  if (responseSetIds().isPresent()) {
    for (final String id : responseSetIds().get().keySet()) {
      checkArgument(!id.contains("-"), "Event frame IDs may not contain -s");
      checkArgument(!id.contains("\t"), "Event frame IDs may not contain tabs");
    }
    // we can have an empty output file, verify that all the responseSets have an id
    checkArgument(responseSets().size() == responseSetIds().get().size(),
        "Response set IDs are missing");
    checkArgument(responseSetIds().get().keySet().size() == responseSets().size(),
        "All response set IDs must be unique");
    CollectionUtils.assertSameElementsOrIllegalArgument(responseSets(),
        responseSetIds().get().values(), "Response sets did not match IDs",
        "Response sets in list", "Response sets in ID map");
  }
}
 
开发者ID:isi-nlp,项目名称:tac-kbp-eal,代码行数:25,代码来源:_ResponseLinking.java

示例2: check

import com.bbn.bue.common.collections.CollectionUtils; //导入方法依赖的package包/类
@Value.Check
protected void check() {
  for (final TypeRoleFillerRealisSet eventFrame : eventFrames()) {
    final Set<TypeRoleFillerRealis> intersection =
        Sets.intersection(eventFrame.asSet(), incomplete());
    checkArgument(intersection.isEmpty(), "A TRFR cannot be both incomplete and linked: %s",
        intersection);
  }
  if (idsToEventFrames().isPresent()) {
    for (final String id : idsToEventFrames().get().keySet()) {
      checkArgument(!id.contains("-"), "Event frame IDs may not contain -s");
      checkArgument(!id.contains("\t"), "Event frame IDs may not contain tabs");
    }
    CollectionUtils.assertSameElementsOrIllegalArgument(eventFrames(),
        idsToEventFrames().get().values(), "Event frames did not match IDs",
        "Event frames in list", "Event frames in ID map");
  }
}
 
开发者ID:isi-nlp,项目名称:tac-kbp-eal,代码行数:19,代码来源:_EventArgumentLinking.java


注:本文中的com.bbn.bue.common.collections.CollectionUtils.assertSameElementsOrIllegalArgument方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。