reactor.util.function.Tuples.tupleStringRepresentation()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(1.6k)|赞(0)|评价(0)|浏览(169)

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

Tuples.tupleStringRepresentation介绍

[英]Prepare a string representation of the values suitable for a Tuple of any size by accepting an array of elements. This builds a StringBuildercontaining the String representation of each object, comma separated. It manages nulls as well by putting an empty string and the comma.
[中]通过接受元素数组,准备适合任何大小元组的值的字符串表示形式。这将构建一个StringBuilder,包含每个对象的字符串表示形式,以逗号分隔。它还通过放置空字符串和逗号来管理空值。

代码示例

代码示例来源:origin: reactor/reactor-core

  1. /**
  2. * A Tuple String representation is the comma separated list of values, enclosed
  3. * in square brackets.
  4. * @return the Tuple String representation
  5. */
  6. @Override
  7. public final String toString() {
  8. return Tuples.tupleStringRepresentation(toArray()).insert(0, '[').append(']').toString();
  9. }
  10. }

代码示例来源:origin: reactor/reactor-core

  1. @Test
  2. public void tupleStringRepresentationSparse() {
  3. assertThat(Tuples.tupleStringRepresentation(null, 2, null, 4, 5, null)
  4. .toString())
  5. .isEqualTo(",2,,4,5,");
  6. }

代码示例来源:origin: reactor/reactor-core

  1. @Test
  2. public void tupleStringRepresentationFull() {
  3. assertThat(Tuples.tupleStringRepresentation(1, 2, 3, 4, 5)
  4. .toString())
  5. .isEqualTo("1,2,3,4,5");
  6. }

代码示例来源:origin: io.projectreactor/reactor-core

  1. /**
  2. * A Tuple String representation is the comma separated list of values, enclosed
  3. * in square brackets.
  4. * @return the Tuple String representation
  5. */
  6. @Override
  7. public final String toString() {
  8. return Tuples.tupleStringRepresentation(toArray()).insert(0, '[').append(']').toString();
  9. }
  10. }

相关文章