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


Java Joiner类代码示例

本文整理汇总了Java中avro.shaded.com.google.common.base.Joiner的典型用法代码示例。如果您正苦于以下问题:Java Joiner类的具体用法?Java Joiner怎么用?Java Joiner使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Joiner类属于avro.shaded.com.google.common.base包,在下文中一共展示了Joiner类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: EmbeddedWikipediaExample

import avro.shaded.com.google.common.base.Joiner; //导入依赖的package包/类
@CliObjectSupport(argumentNames = {"topics"})
public EmbeddedWikipediaExample(String... topics) throws JobTemplate.TemplateException, IOException {
  super("Wikipedia");
  try {
    setTemplate(ResourceBasedJobTemplate.forResourcePath("wikipedia.template"));
  } catch (URISyntaxException | SpecNotFoundException exc) {
    throw new RuntimeException("Could not instantiate an " + EmbeddedWikipediaExample.class.getName(), exc);
  }
  this.setConfiguration("titles", Joiner.on(",").join(topics));
}
 
开发者ID:apache,项目名称:incubator-gobblin,代码行数:11,代码来源:EmbeddedWikipediaExample.java

示例2: buildNs

import avro.shaded.com.google.common.base.Joiner; //导入依赖的package包/类
private String buildNs(DataTable table, MetaVersion ver) {
    return Joiner.on(".").join(Utils.getDataSourceNamespace(), table.getSchema(), table.getTableName(),
            ver.getVersion(), 0, table.isPartationTable() ? "*" : 0);
}
 
开发者ID:BriData,项目名称:DBus,代码行数:5,代码来源:HeartbeatDefaultHandler.java

示例3: verifyPrecedenceWithDefaultConfigFile

import avro.shaded.com.google.common.base.Joiner; //导入依赖的package包/类
@Test
public void verifyPrecedenceWithDefaultConfigFile()
        throws Exception
{
    Path projectDir = folder.newFolder().toPath();
    addWorkflow(projectDir, "acceptance/params.dig");

    Path home = folder.newFolder().toPath().resolve("home");
    Path configFile = home.resolve(".config").resolve("digdag").resolve("config");
    Files.createDirectories(configFile.getParent());

    TestUtils.fakeHome(home.toString(), () -> {
        Files.write(configFile, asList(
                "params.param1=defaultConfigValue1",
                "params.param2=defaultConfigValue2",
                "params.param3=defaultConfigValue3",
                "params.param4=defaultConfigValue4"
        ));
        Map<String, String> env = ImmutableMap.of(
                "DIGDAG_CONFIG", Joiner.on('\n').join(
                        "params.param2=envConfigValue2",
                        "params.param3=envConfigValue3",
                        "params.param4=envConfigValue4"
                )
        );
        TestUtils.withSystemProperties(ImmutableMap.of(
                "params.param3", "systemPropValue3",
                "params.param4", "systemPropValue4"), () -> {
            main(env,
                    "run",
                    "-o", folder.newFolder().getAbsolutePath(),
                    "--project", projectDir.toString(),
                    "-p", "param4=commandLinePropValue4",
                    "params.dig");
        });
    });
    assertThat(Files.readAllLines(projectDir.resolve("param1.out")), contains("defaultConfigValue1"));
    assertThat(Files.readAllLines(projectDir.resolve("param2.out")), contains("envConfigValue2"));
    assertThat(Files.readAllLines(projectDir.resolve("param3.out")), contains("systemPropValue3"));
    assertThat(Files.readAllLines(projectDir.resolve("param4.out")), contains("commandLinePropValue4"));
}
 
开发者ID:treasure-data,项目名称:digdag,代码行数:42,代码来源:ConfigIT.java

示例4: verifyPrecedenceWithExplicitConfigFile

import avro.shaded.com.google.common.base.Joiner; //导入依赖的package包/类
@Test
public void verifyPrecedenceWithExplicitConfigFile()
        throws Exception
{
    Path projectDir = folder.newFolder().toPath();
    addWorkflow(projectDir, "acceptance/params.dig");

    Path home = folder.newFolder().toPath().resolve("home");
    Path defaultConfigFile = home.resolve(".config").resolve("digdag").resolve("config");
    Files.createDirectories(defaultConfigFile.getParent());

    Path explicitConfig = folder.newFolder().toPath().resolve("explicit-config");
    Files.write(explicitConfig, asList(
            "params.param3=explicitConfigValue3",
            "params.param4=explicitConfigValue4"
    ));

    TestUtils.fakeHome(home.toString(), () -> {
        Files.write(defaultConfigFile, asList(
                "params.param1=defaultConfigValue1",
                "params.param2=defaultConfigValue2",
                "params.param3=defaultConfigValue3",
                "params.param4=defaultConfigValue4"
        ));
        Map<String, String> env = ImmutableMap.of(
                "DIGDAG_CONFIG", Joiner.on('\n').join(
                        "params.param1=envConfigValue1",
                        "params.param2=envConfigValue2",
                        "params.param3=envConfigValue3",
                        "params.param4=envConfigValue4"
                )
        );
        TestUtils.withSystemProperties(ImmutableMap.of(
                "params.param2", "systemPropValue2",
                "params.param3", "systemPropValue3",
                "params.param4", "systemPropValue4"), () -> {
            main(env,
                    "run",
                    "-o", folder.newFolder().getAbsolutePath(),
                    "--config", explicitConfig.toString(),
                    "--project", projectDir.toString(),
                    "-p", "param4=commandLinePropValue4",
                    "params.dig");
        });
    });
    assertThat(Files.readAllLines(projectDir.resolve("param1.out")), contains("envConfigValue1"));
    assertThat(Files.readAllLines(projectDir.resolve("param2.out")), contains("systemPropValue2"));
    assertThat(Files.readAllLines(projectDir.resolve("param3.out")), contains("explicitConfigValue3"));
    assertThat(Files.readAllLines(projectDir.resolve("param4.out")), contains("commandLinePropValue4"));
}
 
开发者ID:treasure-data,项目名称:digdag,代码行数:51,代码来源:ConfigIT.java


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