當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。