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


Java ImmutableList.of方法代码示例

本文整理汇总了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);
            }
        }
    });
}
 
开发者ID:shaie,项目名称:browze,代码行数:20,代码来源:ZooResource.java

示例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");
}
 
开发者ID:vcu-swim-lab,项目名称:stack-intheflow,代码行数:9,代码来源:QuestionTest.java

示例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));
  }
}
 
开发者ID:streamsets,项目名称:datacollector,代码行数:29,代码来源:TestMapReduceConfig.java

示例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)));
}
 
开发者ID:vcu-swim-lab,项目名称:stack-intheflow,代码行数:7,代码来源:SumCombinerTest.java

示例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));
}
 
开发者ID:Microsoft,项目名称:vso-intellij,代码行数:4,代码来源:StatusCommand.java


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