/** * Constructs a builder for the specified object. * * <p>If the style is <code>null</code>, the default style is used. * * <p>If the buffer is <code>null</code>, a new one is created. * * @param object the Object to build a <code>toString</code> for, not recommended to be null * @param style the style of the <code>toString</code> to create, null uses the default style * @param buffer the <code>StringBuffer</code> to populate, may be null */ public ToStringBuilder(Object object, ToStringStyle style, StringBuffer buffer) { if (style == null) { style = getDefaultStyle(); } if (buffer == null) { buffer = new StringBuffer(512); } this.buffer = buffer; this.style = style; this.object = object; style.appendStart(buffer, object); }
public ToStringBuilder( Object paramObject, ToStringStyle paramToStringStyle, StringBuffer paramStringBuffer) { ToStringStyle localToStringStyle = paramToStringStyle; if (paramToStringStyle == null) { localToStringStyle = getDefaultStyle(); } paramToStringStyle = paramStringBuffer; if (paramStringBuffer == null) { paramToStringStyle = new StringBuffer(512); } buffer = paramToStringStyle; style = localToStringStyle; object = paramObject; localToStringStyle.appendStart(paramToStringStyle, paramObject); }