/** * {@inheritDoc} This implementation puts a reference to this object under a * reserved key in the resulting parameters map. */ @Override public Map<String, Object> getParameters() { final Map<String, Object> params = super.getParameters(); params.put(PARAM_KEY, this); return params; }
/** * {@inheritDoc} This implementation returns a map which contains this * object itself under a specific key. The static {@code fromParameters()} * method can be used to extract an instance from a parameters map. */ @Override public Map<String, Object> getParameters() { final Map<String, Object> params = super.getParameters(); params.put(PARAM_KEY, this); return params; }
/** * {@inheritDoc} This implementation returns a map which contains this * object itself under a specific key. The static {@code fromParameters()} * method can be used to extract an instance from a parameters map. Of * course, the properties inherited from the base class are also added to * the result map. */ @Override public Map<String, Object> getParameters() { final Map<String, Object> params = super.getParameters(); params.put(PARAM_KEY, this); return params; }
/** * Clones this object. This is useful because multiple builder instances may * use a similar set of parameters. However, single instances of parameter * objects must not assigned to multiple builders. Therefore, cloning a * parameters object provides a solution for this use case. This method * creates a new parameters object with the same content as this one. The * internal map storing the parameter values is cloned, too, also collection * structures contained in this map. However, no a full deep clone operation * is performed. Objects like a {@code ConfigurationInterpolator} or * {@code Lookup}s are shared between this and the newly created instance. * * @return a clone of this object */ @Override public BasicBuilderParameters clone() { try { final BasicBuilderParameters copy = (BasicBuilderParameters) super.clone(); copy.properties = getParameters(); return copy; } catch (final CloneNotSupportedException cnex) { // should not happen throw new AssertionError(cnex); } }