本文整理汇总了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");
}
}
示例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");
}
}