本文整理了Java中org.apache.brooklyn.util.text.Strings.toStringSupplier()
方法的一些代码示例,展示了Strings.toStringSupplier()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Strings.toStringSupplier()
方法的具体详情如下:
包路径:org.apache.brooklyn.util.text.Strings
类名称: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");
}
内容来源于网络,如有侵权,请联系作者删除!