org.apache.calcite.util.Util.commaList()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(116)

本文整理了Java中org.apache.calcite.util.Util.commaList()方法的一些代码示例,展示了Util.commaList()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.commaList()方法的具体详情如下:
包路径:org.apache.calcite.util.Util
类名称:Util
方法名:commaList

Util.commaList介绍

[英]Converts a list of a string, with commas between elements.

For example, commaList(Arrays.asList({"a", "b"})) returns "a, b".
[中]转换字符串列表,元素之间使用逗号。
例如,commaList(Arrays.asList({"a", "b"}))返回“a,b”。

代码示例

代码示例来源:origin: Qihoo360/Quicksql

@Override public String toString() {
 return Util.commaList(all());
}

代码示例来源:origin: org.apache.calcite/calcite-core

@Override public String toString() {
 return Util.commaList(all());
}

代码示例来源:origin: org.apache.calcite/calcite-core

/** Tests {@link Util#commaList(java.util.List)}. */
@Test public void testCommaList() {
 try {
  String s = Util.commaList(null);
  fail("expected NPE, got " + s);
 } catch (NullPointerException e) {
  // ok
 }
 assertThat(Util.commaList(ImmutableList.of()), equalTo(""));
 assertThat(Util.commaList(ImmutableList.of(1)), equalTo("1"));
 assertThat(Util.commaList(ImmutableList.of(2, 3)), equalTo("2, 3"));
 assertThat(Util.commaList(Arrays.asList(2, null, 3)),
   equalTo("2, null, 3"));
}

代码示例来源:origin: Qihoo360/Quicksql

/** Tests {@link Util#commaList(java.util.List)}. */
@Test public void testCommaList() {
 try {
  String s = Util.commaList(null);
  fail("expected NPE, got " + s);
 } catch (NullPointerException e) {
  // ok
 }
 assertThat(Util.commaList(ImmutableList.of()), equalTo(""));
 assertThat(Util.commaList(ImmutableList.of(1)), equalTo("1"));
 assertThat(Util.commaList(ImmutableList.of(2, 3)), equalTo("2, 3"));
 assertThat(Util.commaList(Arrays.asList(2, null, 3)),
   equalTo("2, null, 3"));
}

代码示例来源:origin: org.apache.calcite/calcite-core

+ sql2.substring("values (".length(), sql2.length() - 1)
+ " from (values ("
+ Util.commaList(Pair.left(values))
+ ")) as t("
+ Util.commaList(Pair.right(values))
+ ")";

代码示例来源:origin: Qihoo360/Quicksql

+ sql2.substring("values (".length(), sql2.length() - 1)
+ " from (values ("
+ Util.commaList(Pair.left(values))
+ ")) as t("
+ Util.commaList(Pair.right(values))
+ ")";

相关文章