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 the getToStringParameters(ToStringParameters)-method.
A ToStringParameterPossessor implements its Object.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 the
getToStringParameters(ToStringParameters)-method of several super-classes to collect all
super-parameter-informations and than add its own parameters.
- Author:
- agz
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidgetToStringParameters(ToStringParameters toStringParameters) This method collects theToStringParametersfor the standardObject.toString()-format.
-
Method Details
-
getToStringParameters
This method collects theToStringParametersfor 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-ToStringParametersto fill with parameter-informations for the standardObject.toString()-format
-