/** * Provide a textual representation of this {@code AnnotationDescriptor}. */ @Override public String toString() { return new ToStringCreator(this) .append("rootDeclaringClass", this.rootDeclaringClass) .append("declaringClass", this.declaringClass) .append("composedAnnotation", this.composedAnnotation) .append("annotation", this.annotation) .toString(); } }
/** * Append a field value. * @param fieldName the name of the field, usually the member variable name * @param value the field value * @return this, to support call-chaining */ public ToStringCreator append(String fieldName, @Nullable Object value) { printFieldSeparatorIfNecessary(); this.styler.styleField(this.buffer, fieldName, value); return this; }
/** * Append a byte field value. * @param fieldName the name of the field, usually the member variable name * @param value the field value * @return this, to support call-chaining */ public ToStringCreator append(String fieldName, byte value) { return append(fieldName, Byte.valueOf(value)); }
@Test public void primitiveArrays() { int[] integers = new int[] {0, 1, 2, 3, 4}; String str = new ToStringCreator(integers).toString(); assertEquals("[@" + ObjectUtils.getIdentityHexString(integers) + " array<Integer>[0, 1, 2, 3, 4]]", str); }
/** * Append a short field value. * @param fieldName the name of the field, usually the member variable name * @param value the field value * @return this, to support call-chaining */ public ToStringCreator append(String fieldName, short value) { return append(fieldName, Short.valueOf(value)); }
@Test public void defaultStyleArray() { SomeObject[] array = new SomeObject[] {s1, s2, s3}; String str = new ToStringCreator(array).toString(); assertEquals("[@" + ObjectUtils.getIdentityHexString(array) + " array<ToStringCreatorTests.SomeObject>[A, B, C]]", str); }
/** * Provide a String representation of this test context's state. */ @Override public String toString() { return new ToStringCreator(this) .append("testClass", this.testClass) .append("testInstance", this.testInstance) .append("testMethod", this.testMethod) .append("testException", this.testException) .append("mergedContextConfiguration", this.mergedContextConfiguration) .append("attributes", this.attributes) .toString(); }
/** * Append a long field value. * @param fieldName the name of the field, usually the member variable name * @param value the field value * @return this, to support call-chaining */ public ToStringCreator append(String fieldName, long value) { return append(fieldName, Long.valueOf(value)); }
/** * Append a field value. * @param fieldName the name of the field, usually the member variable name * @param value the field value * @return this, to support call-chaining */ public ToStringCreator append(String fieldName, @Nullable Object value) { printFieldSeparatorIfNecessary(); this.styler.styleField(this.buffer, fieldName, value); return this; }
/** * Provide a String representation of the merged SQL script configuration. */ @Override public String toString() { return new ToStringCreator(this) .append("dataSource", this.dataSource) .append("transactionManager", this.transactionManager) .append("transactionMode", this.transactionMode) .append("encoding", this.encoding) .append("separator", this.separator) .append("commentPrefix", this.commentPrefix) .append("blockCommentStartDelimiter", this.blockCommentStartDelimiter) .append("blockCommentEndDelimiter", this.blockCommentEndDelimiter) .append("errorMode", this.errorMode) .toString(); }
/** * Append a double field value. * @param fieldName the name of the field, usually the member variable name * @param value the field value * @return this, to support call-chaining */ public ToStringCreator append(String fieldName, double value) { return append(fieldName, Double.valueOf(value)); }
/** * Append a field value. * @param fieldName the name of the field, usually the member variable name * @param value the field value * @return this, to support call-chaining */ public ToStringCreator append(String fieldName, Object value) { printFieldSeparatorIfNecessary(); this.styler.styleField(this.buffer, fieldName, value); return this; }
/** * Provide a String representation of this bootstrap context's state. */ @Override public String toString() { return new ToStringCreator(this)// .append("testClass", this.testClass.getName())// .append("cacheAwareContextLoaderDelegate", this.cacheAwareContextLoaderDelegate.getClass().getName())// .toString(); }
/** * Append a boolean field value. * @param fieldName the name of the field, usually the member variable name * @param value the field value * @return this, to support call-chaining */ public ToStringCreator append(String fieldName, boolean value) { return append(fieldName, Boolean.valueOf(value)); }
/** * Provide a String representation of the {@code @TestPropertySource} * attributes and declaring class. */ @Override public String toString() { return new ToStringCreator(this)// .append("declaringClass", this.declaringClass.getName())// .append("locations", ObjectUtils.nullSafeToString(this.locations))// .append("inheritLocations", this.inheritLocations)// .append("properties", ObjectUtils.nullSafeToString(this.properties))// .append("inheritProperties", this.inheritProperties)// .toString(); }
/** * Append a integer field value. * @param fieldName the name of the field, usually the member variable name * @param value the field value * @return this, to support call-chaining */ public ToStringCreator append(String fieldName, int value) { return append(fieldName, Integer.valueOf(value)); }
/** * Provide a String representation of the context configuration attributes * and declaring class. */ @Override public String toString() { return new ToStringCreator(this) .append("declaringClass", this.declaringClass.getName()) .append("classes", ObjectUtils.nullSafeToString(this.classes)) .append("locations", ObjectUtils.nullSafeToString(this.locations)) .append("inheritLocations", this.inheritLocations) .append("initializers", ObjectUtils.nullSafeToString(this.initializers)) .append("inheritInitializers", this.inheritInitializers) .append("name", this.name) .append("contextLoaderClass", this.contextLoaderClass.getName()) .toString(); }
/** * Append a float field value. * @param fieldName the name of the field, usually the member variable name * @param value the field value * @return this, to support call-chaining */ public ToStringCreator append(String fieldName, float value) { return append(fieldName, Float.valueOf(value)); }
@Override public String toString() { return new ToStringCreator(this) .append("delegate", delegate) .append("properties", properties) .toString(); } }
/** * Append a integer field value. * @param fieldName the name of the field, usually the member variable name * @param value the field value * @return this, to support call-chaining */ public ToStringCreator append(String fieldName, int value) { return append(fieldName, Integer.valueOf(value)); }