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

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

本文整理了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

/**
   * A Tuple String representation is the comma separated list of values, enclosed
   * in square brackets.
   * @return the Tuple String representation
   */
  @Override
  public final String toString() {
    return Tuples.tupleStringRepresentation(toArray()).insert(0, '[').append(']').toString();
  }
}

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

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

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

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

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

/**
   * A Tuple String representation is the comma separated list of values, enclosed
   * in square brackets.
   * @return the Tuple String representation
   */
  @Override
  public final String toString() {
    return Tuples.tupleStringRepresentation(toArray()).insert(0, '[').append(']').toString();
  }
}

相关文章