@Test public void test1() { DateTime date = new DateTime(); Employee employee1 = new Employee("Daniel Li", 20, date); Employee employee2 = new Employee("Daniel Li", 20, date); Manager manager1 = new Manager("Daniel Li", 20, date, 0); Manager manager2 = new Manager("Daniel Li", 20, date, 0) { }; PerformanceMonitor.start("ToStringBuilderUtilsTest"); LOGGER.info(String.valueOf(ToStringBuilder.reflectionToString(employee1))); PerformanceMonitor.mark("ToStringBuilder.reflectionToString(employee1)"); LOGGER.info(String.valueOf(ToStringBuilderUtils.reflectionToString(employee1))); PerformanceMonitor.mark("ToStringBuilderUtils.reflectionToString(employee1)"); LOGGER.info(String.valueOf(ToStringBuilder.reflectionToString(employee2))); PerformanceMonitor.mark("ToStringBuilder.reflectionToString(employee2)"); LOGGER.info(String.valueOf(ToStringBuilderUtils.reflectionToString(employee2))); PerformanceMonitor.mark("ToStringBuilderUtils.reflectionToString(employee2)"); LOGGER.info(String.valueOf(ToStringBuilder.reflectionToString(manager1))); PerformanceMonitor.mark("ToStringBuilder.reflectionToString(manager1)"); LOGGER.info(String.valueOf(ToStringBuilderUtils.reflectionToString(manager1))); PerformanceMonitor.mark("ToStringBuilderUtils.reflectionToString(manager1)"); LOGGER.info(String.valueOf(ToStringBuilder.reflectionToString(manager2))); PerformanceMonitor.mark("ToStringBuilder.reflectionToString(manager2)"); LOGGER.info(String.valueOf(ToStringBuilderUtils.reflectionToString(manager2))); PerformanceMonitor.mark("ToStringBuilderUtils.reflectionToString(manager2)"); PerformanceMonitor.stop(); PerformanceMonitor.summarize(new AdvancedStopWatchSummary(false)); PerformanceMonitor.remove(); }
public static String reflectionToString(Object object) { ToStringBuilder builder = new ToStringBuilder(object); Class<?> clazz = object.getClass(); reflectionAppend(object, clazz, builder); while (clazz.getSuperclass() != null) { clazz = clazz.getSuperclass(); reflectionAppend(object, clazz, builder); } return builder.toString(); }
ToStringBuilderUtils { public static String reflectionToString(Object object) { ToStringBuilder builder = new ToStringBuilder(object); Class<?> clazz = object.getClass(); reflectionAppend(object, clazz, builder); while (clazz.getSuperclass() != null) { clazz = clazz.getSuperclass(); reflectionAppend(object, clazz, builder); } return builder.toString(); } }
ToStringBuilderUtils { public static String reflectionToString(Object object) { ToStringBuilder builder = new ToStringBuilder(object); Class<?> clazz = object.getClass(); reflectionAppend(object, clazz, builder); while (clazz.getSuperclass() != null) { clazz = clazz.getSuperclass(); reflectionAppend(object, clazz, builder); } return builder.toString(); }  }
ToStringBuilderUtils { public static String reflectionToString(Object object) { ToStringBuilder builder = new ToStringBuilder(object); Class<?> clazz = object.getClass(); reflectionAppend(object, clazz, builder); while (clazz.getSuperclass() != null) { clazz = clazz.getSuperclass(); reflectionAppend(object, clazz, builder); } return builder.toString(); }  static String reflectionToString(Object object); }
ToStringBuilderUtils { public static String reflectionToString(Object object) { ToStringBuilder builder = new ToStringBuilder(object); Class<?> clazz = object.getClass(); reflectionAppend(object, clazz, builder); while (clazz.getSuperclass() != null) { clazz = clazz.getSuperclass(); reflectionAppend(object, clazz, builder); } return builder.toString(); }  static String reflectionToString(Object object);  }