Class ToStringParameters

java.lang.Object
com.saperion.common.lang.format.ToStringParameters

public final class ToStringParameters extends Object
ToStringParameters collects the parameter-informations for the standard Object.toString()-format of a ToStringParameterPossessor.
Author:
agz
See Also:
  • Method Details

    • add

      public void add(String parameterName, Object parameterValue)
      Adds a parameter with the specified name and value to this ToStringParameters.

      If there is a parameter with the same name already the new parameter will NOT be added. This guarantees that in a diamond-shaped multiple inheritance situation the parameters of the topmost superclass are not added several times.

      Same name means instance equality, i.e. the same string literal constant name will not be added twice, but if one specifies a dynamically created name the parameter will be added twice. It is recommended (and the usual way) to use string literal constants for toString-parameter names always.

      The parameter name must not be null (but may be an empty string).

      The parameter value may be null.

      Parameters:
      parameterName - parameter name
      parameterValue - parameter value