/** * Constructor. * * @param <T> * the type of the object * @param object * the Object to build a <code>toString</code> for * @param style * the style of the <code>toString</code> to create, may be <code>null</code> * @param buffer * the <code>StringBuffer</code> to populate, may be <code>null</code> * @param reflectUpToClass * the superclass to reflect up to (inclusive), may be <code>null</code> * @param outputTransients * whether to include transient fields * @param outputStatics * whether to include static fields * @since 2.1 */ public <T> ReflectionToStringBuilder( final T object, final ToStringStyle style, final StringBuffer buffer, final Class<? super T> reflectUpToClass, final boolean outputTransients, final boolean outputStatics) { super(checkNotNull(object), style, buffer); this.setUpToClass(reflectUpToClass); this.setAppendTransients(outputTransients); this.setAppendStatics(outputStatics); }
/** * Tests ReflectionToStringBuilder setUpToClass(). */ @Test public void test_setUpToClass_valid() { final Integer val = Integer.valueOf(5); final ReflectionToStringBuilder test = new ReflectionToStringBuilder(val); test.setUpToClass(Number.class); test.toString(); }
/** * Tests ReflectionToStringBuilder setUpToClass(). */ @Test(expected=IllegalArgumentException.class) public void test_setUpToClass_invalid() { final Integer val = Integer.valueOf(5); final ReflectionToStringBuilder test = new ReflectionToStringBuilder(val); try { test.setUpToClass(String.class); } finally { test.toString(); } }
final boolean excludeNullValues) { super(checkNotNull(object), style, buffer); this.setUpToClass(reflectUpToClass); this.setAppendTransients(outputTransients); this.setAppendStatics(outputStatics);
/** * Constructor. * * @param <T> * the type of the object * @param object * the Object to build a <code>toString</code> for * @param style * the style of the <code>toString</code> to create, may be <code>null</code> * @param buffer * the <code>StringBuffer</code> to populate, may be <code>null</code> * @param reflectUpToClass * the superclass to reflect up to (inclusive), may be <code>null</code> * @param outputTransients * whether to include transient fields * @param outputStatics * whether to include static fields * @since 2.1 */ public <T> ReflectionToStringBuilder( final T object, final ToStringStyle style, final StringBuffer buffer, final Class<? super T> reflectUpToClass, final boolean outputTransients, final boolean outputStatics) { super(checkNotNull(object), style, buffer); this.setUpToClass(reflectUpToClass); this.setAppendTransients(outputTransients); this.setAppendStatics(outputStatics); }
/** * Constructor. * * @param <T> * the type of the object * @param object * the Object to build a <code>toString</code> for * @param style * the style of the <code>toString</code> to create, may be <code>null</code> * @param buffer * the <code>StringBuffer</code> to populate, may be <code>null</code> * @param reflectUpToClass * the superclass to reflect up to (inclusive), may be <code>null</code> * @param outputTransients * whether to include transient fields * @param outputStatics * whether to include static fields * @since 2.1 */ public <T> ReflectionToStringBuilder( final T object, final ToStringStyle style, final StringBuffer buffer, final Class<? super T> reflectUpToClass, final boolean outputTransients, final boolean outputStatics) { super(checkNotNull(object), style, buffer); this.setUpToClass(reflectUpToClass); this.setAppendTransients(outputTransients); this.setAppendStatics(outputStatics); }
/** * Constructor. * * @param <T> * the type of the object * @param object * the Object to build a <code>toString</code> for * @param style * the style of the <code>toString</code> to create, may be <code>null</code> * @param buffer * the <code>StringBuffer</code> to populate, may be <code>null</code> * @param reflectUpToClass * the superclass to reflect up to (inclusive), may be <code>null</code> * @param outputTransients * whether to include transient fields * @param outputStatics * whether to include static fields * @since 2.1 */ public <T> ReflectionToStringBuilder( final T object, final ToStringStyle style, final StringBuffer buffer, final Class<? super T> reflectUpToClass, final boolean outputTransients, final boolean outputStatics) { super(checkNotNull(object), style, buffer); this.setUpToClass(reflectUpToClass); this.setAppendTransients(outputTransients); this.setAppendStatics(outputStatics); }
final boolean excludeNullValues) { super(checkNotNull(object), style, buffer); this.setUpToClass(reflectUpToClass); this.setAppendTransients(outputTransients); this.setAppendStatics(outputStatics);
final boolean excludeNullValues) { super(checkNotNull(object), style, buffer); this.setUpToClass(reflectUpToClass); this.setAppendTransients(outputTransients); this.setAppendStatics(outputStatics);
final boolean excludeNullValues) { super(checkNotNull(object), style, buffer); this.setUpToClass(reflectUpToClass); this.setAppendTransients(outputTransients); this.setAppendStatics(outputStatics);