Paul Clapham wrote:So now you're going to have "private String specialErrorMessage" in there as well as the other three types of message?
I'd suggest stop making "errorMessage" be handled differently than the other message types. Have only one constructor which takes no parameters and have all of the data fields set by "setXXXMessage" methods.
You could also have the "setXXXMessage" methods return "this" instead of void, so you could chain them together:
Then you could write
Just to clarify, you are suggesting to replace the following method:
with the following, right?
And I would still define
private String specialErrorMessage and using it's setter method, I could do the following:
Please let me know if I misunderstood anything here. Thanks