Package com.saperion.common.lang.format
Interface ToStringParameterPossessor
-
public interface ToStringParameterPossessor
This interface tags objects that provide their parameter-informations for the standard
Object.toString()
-format by implementing thegetToStringParameters(ToStringParameters)
-method.A
ToStringParameterPossessor
implements itsObject.toString()
-method this way:return ToStringFormatter.format(this);
This is especially attractive in multiple-inheritance hierarchies because the implementation of
getToStringParameters(ToStringParameters)
of a subclass can call thegetToStringParameters(ToStringParameters)
-method of several super-classes to collect all super-parameter-informations and than add its own parameters.- Author:
- agz
- See Also:
ToStringFormatter.format(ToStringParameterPossessor)
,ToStringParameters
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
getToStringParameters(ToStringParameters toStringParameters)
This method collects theToStringParameters
for the standardObject.toString()
-format.
-
-
-
Method Detail
-
getToStringParameters
void getToStringParameters(ToStringParameters toStringParameters)
This method collects theToStringParameters
for the standardObject.toString()
-format. Implementations should first call the same method of all super-classes with the specifiedToStringParameters
-instance to collect the parameter-informations of these super-classes and than add their own parameter-informations by calls toToStringParameters.add(String, Object)
.- Parameters:
toStringParameters
-ToStringParameters
to fill with parameter-informations for the standardObject.toString()
-format
-
-