本文整理匯總了Java中com.google.common.collect.ImmutableSet.containsAll方法的典型用法代碼示例。如果您正苦於以下問題:Java ImmutableSet.containsAll方法的具體用法?Java ImmutableSet.containsAll怎麽用?Java ImmutableSet.containsAll使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.common.collect.ImmutableSet
的用法示例。
在下文中一共展示了ImmutableSet.containsAll方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: assertExactlyTwoSubdirectories
import com.google.common.collect.ImmutableSet; //導入方法依賴的package包/類
private void assertExactlyTwoSubdirectories(final File outputStoreDir) throws IOException {
checkArgument(outputStoreDir.isDirectory());
if (!new File(outputStoreDir, "arguments").isDirectory()) {
throw new IOException(
"Expected system output to be contain a subdirectory named 'arguments'");
}
if (!new File(outputStoreDir, "linking").isDirectory()) {
throw new IOException("Expected system output to be contain a subdirectory named 'linking'");
}
final ImmutableSet<String> subdirectoryNames =
FluentIterable.from(ImmutableList.copyOf(outputStoreDir.listFiles()))
.transform(FileUtils.ToName)
.toSet();
final boolean hasValidDirectoryStructure = subdirectoryNames.containsAll(REQUIRED_SUBDIRS)
&& ALLOWED_SUBDIRS.containsAll(subdirectoryNames);
if (!hasValidDirectoryStructure) {
throw new IOException(
"Invalid subdirectories ) " + subdirectoryNames + ". Required are: " + REQUIRED_SUBDIRS
+ "; allowed are " + ALLOWED_SUBDIRS);
}
}