本文整理汇总了Java中jersey.repackaged.com.google.common.collect.ImmutableList.of方法的典型用法代码示例。如果您正苦于以下问题:Java ImmutableList.of方法的具体用法?Java ImmutableList.of怎么用?Java ImmutableList.of使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jersey.repackaged.com.google.common.collect.ImmutableList
的用法示例。
在下文中一共展示了ImmutableList.of方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getChildren
import jersey.repackaged.com.google.common.collect.ImmutableList; //导入方法依赖的package包/类
private List<Tree> getChildren(final String zkPath, final Stat stat) throws Exception {
if (stat.getNumChildren() == 0) {
return ImmutableList.of();
}
final List<String> children = curatorFramework.getChildren().forPath(zkPath);
return Lists.transform(children, new Function<String, Tree>() {
@Override
public Tree apply(String input) {
try {
final Stat childStat = curatorFramework.checkExists().forPath(ZKPaths.makePath(zkPath, input));
return new Tree(new PathAndNode(zkPath, input), ImmutableList.<Tree> of(), childStat);
} catch (final Exception e) {
// not expected
throw new RuntimeException(e);
}
}
});
}
示例2: setUp
import jersey.repackaged.com.google.common.collect.ImmutableList; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
question = new Question(ImmutableList.of("Tag1", "Tag2"),
"myBody",
"myExcerpt",
"myTitle",
"myLink");
}
示例3: testInitAllSources
import jersey.repackaged.com.google.common.collect.ImmutableList; //导入方法依赖的package包/类
@Test
public void testInitAllSources() throws Exception {
Configuration coreConf = new Configuration();
coreConf.set("coreConf", "present");
writeConfiguration(coreConf, new File(confDir, "core-site.xml"));
Configuration yarnConf = new Configuration();
yarnConf.set("yarnConf", "present");
writeConfiguration(yarnConf, new File(confDir, "yarn-site.xml"));
Configuration mapreduceConf = new Configuration();
mapreduceConf.set("mapreduceConf", "present");
writeConfiguration(mapreduceConf, new File(confDir, "mapred-site.xml"));
Configuration hdfsConf = new Configuration();
hdfsConf.set("hdfsConf", "present");
writeConfiguration(hdfsConf, new File(confDir, "hdfs-site.xml"));
config.mapreduceConfigs = ImmutableMap.of("sdcConf", "present");
List<Stage.ConfigIssue> issues = config.init(context, "prefix");
Assert.assertEquals(0, issues.size());
Configuration finalConf = config.getConfiguration();
for(String property : ImmutableList.of("coreConf", "yarnConf", "mapreduceConf", "sdcConf", "hdfsConf")) {
Assert.assertEquals("Key is not present: " + property, "present", finalConf.get(property));
}
}
示例4: setUp
import jersey.repackaged.com.google.common.collect.ImmutableList; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
sumCombiner = new SumCombiner(ImmutableList.of(new IctfScorer(termStatComponent),
new IctfScorer(termStatComponent),
new IctfScorer(termStatComponent)));
}
示例5: StatusCommand
import jersey.repackaged.com.google.common.collect.ImmutableList; //导入方法依赖的package包/类
public StatusCommand(final ServerContext context, final String localPath) {
this(context, localPath == null ? null : ImmutableList.of(localPath));
}