/** * Return the String representation that this ToStringCreator built. */ @Override public String toString() { this.styler.styleEnd(this.buffer, this.object); return this.buffer.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; }
private void printFieldSeparatorIfNecessary() { if (this.styledFirstField) { this.styler.styleFieldSeparator(this.buffer); } else { this.styledFirstField = true; } }
/** * Append the provided value. * @param value the value to append * @return this, to support call-chaining. */ public ToStringCreator append(Object value) { this.styler.styleValue(this.buffer, value); return this; }
/** * Create a ToStringCreator for the given object, using the provided style. * @param obj the object to be stringified * @param styler the ToStringStyler encapsulating pretty-print instructions */ public ToStringCreator(Object obj, @Nullable ToStringStyler styler) { Assert.notNull(obj, "The object to be styled must not be null"); this.object = obj; this.styler = (styler != null ? styler : DEFAULT_TO_STRING_STYLER); this.styler.styleStart(this.buffer, this.object); }
/** * Append the provided value. * @param value the value to append * @return this, to support call-chaining. */ public ToStringCreator append(Object value) { this.styler.styleValue(this.buffer, value); return this; }
/** * Create a ToStringCreator for the given object, using the provided style. * @param obj the object to be stringified * @param styler the ToStringStyler encapsulating pretty-print instructions */ public ToStringCreator(Object obj, @Nullable ToStringStyler styler) { Assert.notNull(obj, "The object to be styled must not be null"); this.object = obj; this.styler = (styler != null ? styler : DEFAULT_TO_STRING_STYLER); this.styler.styleStart(this.buffer, this.object); }
/** * Return the String representation that this ToStringCreator built. */ @Override public String toString() { this.styler.styleEnd(this.buffer, this.object); return this.buffer.toString(); }
/** * Append the provided value. * @param value The value to append * @return this, to support call-chaining. */ public ToStringCreator append(Object value) { this.styler.styleValue(this.buffer, value); return this; }
/** * Create a ToStringCreator for the given object, using the provided style. * @param obj the object to be stringified * @param styler the ToStringStyler encapsulating pretty-print instructions */ public ToStringCreator(Object obj, ToStringStyler styler) { Assert.notNull(obj, "The object to be styled must not be null"); this.object = obj; this.styler = (styler != null ? styler : DEFAULT_TO_STRING_STYLER); this.styler.styleStart(this.buffer, this.object); }
private void printFieldSeparatorIfNecessary() { if (this.styledFirstField) { this.styler.styleFieldSeparator(this.buffer); } else { this.styledFirstField = true; } }
/** * 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; }
/** * Return the String representation that this ToStringCreator built. */ @Override public String toString() { this.styler.styleEnd(this.buffer, this.object); return this.buffer.toString(); }
/** * Append the provided value. * @param value The value to append * @return this, to support call-chaining. */ public ToStringCreator append(Object value) { this.styler.styleValue(this.buffer, value); return this; }
/** * Create a ToStringBuilder for this object with the provided style. * @param obj the object to be stringified * @param styler the ToStringStyler encapsulating pretty-print instructions */ public ToStringCreator(Object obj, ToStringStyler styler) { Assert.notNull(obj, "The object to be styled is required"); this.object = obj; this.styler = (styler != null ? styler : DEFAULT_TO_STRING_STYLER); this.styler.styleStart(this.buffer, this.object); }
private void printFieldSeparatorIfNecessary() { if (this.styledFirstField) { this.styler.styleFieldSeparator(this.buffer); } else { this.styledFirstField = true; } }
/** * 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; }
/** * Return the String representation that this ToStringCreator built. */ @Override public String toString() { this.styler.styleEnd(this.buffer, this.object); return this.buffer.toString(); }
/** * Append the provided value. * @param value the value to append * @return this, to support call-chaining. */ public ToStringCreator append(Object value) { this.styler.styleValue(this.buffer, value); return this; }
/** * Create a ToStringCreator for the given object, using the provided style. * @param obj the object to be stringified * @param styler the ToStringStyler encapsulating pretty-print instructions */ public ToStringCreator(Object obj, @Nullable ToStringStyler styler) { Assert.notNull(obj, "The object to be styled must not be null"); this.object = obj; this.styler = (styler != null ? styler : DEFAULT_TO_STRING_STYLER); this.styler.styleStart(this.buffer, this.object); }