/** * Return a <code>ToStringOption</code> instance with {@link #appendStatic} option set. if the * current instance is not {@link #DEFAULT_OPTION default instance} then set on the current * instance and return the current instance. Otherwise, clone the default instance and set on the * clone and return the clone * * @param appendStatic * @return this option instance or clone if this is the {@link #DEFAULT_OPTION} */ public ToStringOption setAppendStatic(boolean appendStatic) { ToStringOption op = this; if (this == DEFAULT_OPTION) { op = new ToStringOption(this.appendStatic, this.appendTransient); } op.appendStatic = appendStatic; return op; }
/** * Return a <code>ToStringOption</code> instance with {@link #upToClass} option set. if the * current instance is not {@link #DEFAULT_OPTION default instance} then set on the current * instance and return the current instance. Otherwise, clone the default instance and set on the * clone and return the clone * * @param c * @return this option instance or clone if this is the {@link #DEFAULT_OPTION} */ public ToStringOption setUpToClass(Class<?> c) { ToStringOption op = this; if (this == DEFAULT_OPTION) { op = new ToStringOption(this.appendStatic, this.appendTransient); } op.upToClass = c; return op; }