当前位置: 首页>>代码示例>>Java>>正文


Java RecursiveToStringStyle类代码示例

本文整理汇总了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()));
    }
  }
}
 
开发者ID:makotogo,项目名称:odotCore,代码行数:16,代码来源:ItemDaoTest.java

示例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);
	}
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:39,代码来源:ObjectUtils.java

示例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);
}
 
开发者ID:bassages,项目名称:home-server,代码行数:11,代码来源:SlimmeMeterController.java

示例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));
}
 
开发者ID:ZooMMX,项目名称:Omoikane,代码行数:11,代码来源:CDSServiceTest.java

示例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();
}
 
开发者ID:ExpediaDotCom,项目名称:haystack-client-java,代码行数:7,代码来源:RemoteDispatcher.java

示例6: toString

import org.apache.commons.lang3.builder.RecursiveToStringStyle; //导入依赖的package包/类
@Override
public String toString() {
    return new ReflectionToStringBuilder(this, RecursiveToStringStyle.JSON_STYLE)
        .toString();
}
 
开发者ID:ExpediaDotCom,项目名称:haystack-client-java,代码行数:6,代码来源:LoggerDispatcher.java

示例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();
}
 
开发者ID:ExpediaDotCom,项目名称:haystack-client-java,代码行数:7,代码来源:Tracer.java

示例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();
}
 
开发者ID:ExpediaDotCom,项目名称:haystack-client-java,代码行数:7,代码来源:Span.java

示例9: toString

import org.apache.commons.lang3.builder.RecursiveToStringStyle; //导入依赖的package包/类
@Override
public String toString() {
    return ReflectionToStringBuilder.toString(this, RecursiveToStringStyle.JSON_STYLE);
}
 
开发者ID:blackducksoftware,项目名称:hub-bamboo,代码行数:5,代码来源:HubServerConfigSerializable.java

示例10: dump

import org.apache.commons.lang3.builder.RecursiveToStringStyle; //导入依赖的package包/类
String dump() {
    return ReflectionToStringBuilder.reflectionToString(this, RecursiveToStringStyle.MULTI_LINE_STYLE);
}
 
开发者ID:OpenSilk,项目名称:SyncthingAndroid,代码行数:4,代码来源:SessionRecyclerAdapter.java

示例11: toString

import org.apache.commons.lang3.builder.RecursiveToStringStyle; //导入依赖的package包/类
@Override
public String toString() {
       return ToStringBuilder.reflectionToString(this, RecursiveToStringStyle.JSON_STYLE);
   }
 
开发者ID:oregami,项目名称:oregami-server,代码行数:5,代码来源:BaseEntityUUID.java


注:本文中的org.apache.commons.lang3.builder.RecursiveToStringStyle类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。