org.apache.brooklyn.util.text.Strings.toStringSupplier()方法的使用及代码示例

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

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

Strings.toStringSupplier介绍

暂无

代码示例

代码示例来源:origin: org.apache.brooklyn/brooklyn-utils-common

public Supplier<String> supplier() {
    return Strings.toStringSupplier(this);
  }
}

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

protected WrappedStream(String streamType, ByteArrayOutputStream stream) {
  Preconditions.checkNotNull(streamType);
  Preconditions.checkNotNull(stream);
  this.streamType = streamType;
  this.streamContents = Strings.toStringSupplier(stream);
  this.streamSize = Streams.sizeSupplier(stream);
}
// fix for https://github.com/FasterXML/jackson-databind/issues/543 (which also applies to codehaus jackson)

代码示例来源:origin: org.apache.brooklyn/brooklyn-utils-common

@Test
public void testToStringSupplier() {
  ToStringCounter c = new ToStringCounter(true);
  Assert.assertEquals(Strings.toStringSupplier(c).get(), "world1");
  FormattedString x = Strings.format("hello %s", c);
  Assert.assertEquals(x.toString(), "hello world2");
  Assert.assertEquals(x.toString(), "hello world3");
}

相关文章