本文整理汇总了Java中org.apache.commons.lang3.builder.RecursiveToStringStyle类的典型用法代码示例。如果您正苦于以下问题:Java RecursiveToStringStyle类的具体用法?Java RecursiveToStringStyle怎么用?Java RecursiveToStringStyle使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RecursiveToStringStyle类属于org.apache.commons.lang3.builder包,在下文中一共展示了RecursiveToStringStyle类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testFindAll
import org.apache.commons.lang3.builder.RecursiveToStringStyle; //导入依赖的package包/类
@Test
@DisplayName("Find All Items")
public void testFindAll() {
List<Item> items = classUnderTest.findAll();
assertNotNull(items);
assertAll(
() -> assertFalse(items.isEmpty()),
() -> assertEquals(7, items.size()));
if (log.isDebugEnabled()) {
log.debug("Items found: ");
for (Item item : items) {
log.debug(ReflectionToStringBuilder.toString(item, new RecursiveToStringStyle()));
}
}
}
示例2: toString
import org.apache.commons.lang3.builder.RecursiveToStringStyle; //导入依赖的package包/类
/**
* To be used in {@link Object#toString()} implementations.
*
* Might arbitrarily throw exceptions. Therefore, Please consider to reimplement this, or to use e.g. {@link com.google.common.base.MoreObjects#toStringHelper(Object)}.
*
* @param obj the object to be printed
* @param multiLine if <code>true</code> then use {@link RecursiveIndentedMultilineToStringStyle} to display it in multiple lines.
* @return
*
*/
public static final String toString(final Object obj, final boolean multiLine)
{
if (obj == null)
{
return "<NULL>";
}
try
{
final ToStringStyle toStringStyle;
if (multiLine)
{
toStringStyle = RecursiveIndentedMultilineToStringStyle.instance;
}
else
{
toStringStyle = RecursiveToStringStyle.SHORT_PREFIX_STYLE;
}
return new ExtendedReflectionToStringBuilder(obj, toStringStyle).toString();
}
catch (final Exception e)
{
// task 09493: catching possible errors
// this doesn't work! still invokes the "high-level" toString() method
// return ((Object)obj).toString() + " (WARNING: ExtendedReflectionToStringBuilder threw " + e + ")";
return createFallBackMessage(obj, e);
}
}
示例3: save
import org.apache.commons.lang3.builder.RecursiveToStringStyle; //导入依赖的package包/类
@PostMapping
@ResponseStatus(HttpStatus.CREATED)
public void save(@RequestBody Dsmr42Reading dsmr42Reading) {
if (LOGGER.isInfoEnabled()) {
LOGGER.info(ReflectionToStringBuilder.toString(dsmr42Reading, new RecursiveToStringStyle()));
}
saveMeterstand(dsmr42Reading);
saveOpgenomenVermogen(dsmr42Reading);
}
示例4: debugPrint
import org.apache.commons.lang3.builder.RecursiveToStringStyle; //导入依赖的package包/类
private void debugPrint(Object o) {
RecursiveToStringStyle recursiveToStringStyle = new RecursiveToStringStyle() {{
this.setContentStart("[");
this.setFieldSeparatorAtStart(true);
this.setFieldSeparator(SystemUtils.LINE_SEPARATOR + " ");
this.setContentEnd(SystemUtils.LINE_SEPARATOR + "]");
}};
System.out.println(ToStringBuilder.reflectionToString(o, recursiveToStringStyle));
}
示例5: toString
import org.apache.commons.lang3.builder.RecursiveToStringStyle; //导入依赖的package包/类
@Override
public String toString() {
return new ReflectionToStringBuilder(this, RecursiveToStringStyle.JSON_STYLE)
.setExcludeFieldNames("acceptQueue", "executor", "flushTask", "senderTask")
.toString();
}
示例6: toString
import org.apache.commons.lang3.builder.RecursiveToStringStyle; //导入依赖的package包/类
@Override
public String toString() {
return new ReflectionToStringBuilder(this, RecursiveToStringStyle.JSON_STYLE)
.toString();
}
示例7: toString
import org.apache.commons.lang3.builder.RecursiveToStringStyle; //导入依赖的package包/类
@Override
public String toString() {
return new ReflectionToStringBuilder(this, RecursiveToStringStyle.JSON_STYLE)
.setExcludeFieldNames("clock", "activeSource")
.toString();
}
示例8: toString
import org.apache.commons.lang3.builder.RecursiveToStringStyle; //导入依赖的package包/类
@Override
public String toString() {
return new ReflectionToStringBuilder(this, RecursiveToStringStyle.JSON_STYLE)
.setExcludeFieldNames("tracer", "clock")
.toString();
}
示例9: toString
import org.apache.commons.lang3.builder.RecursiveToStringStyle; //导入依赖的package包/类
@Override
public String toString() {
return ReflectionToStringBuilder.toString(this, RecursiveToStringStyle.JSON_STYLE);
}
示例10: dump
import org.apache.commons.lang3.builder.RecursiveToStringStyle; //导入依赖的package包/类
String dump() {
return ReflectionToStringBuilder.reflectionToString(this, RecursiveToStringStyle.MULTI_LINE_STYLE);
}
示例11: toString
import org.apache.commons.lang3.builder.RecursiveToStringStyle; //导入依赖的package包/类
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this, RecursiveToStringStyle.JSON_STYLE);
}