I have a class, that takes a lot of esoteric parameters to construct an object. I didn't write the code and frankly speaking, I don't understand completely, all of it's nuances. There is a valueOf(String) method of this class, that is primarily used to construct objects of this class and it also does fairly complex computation to construct the object.
I pass an array of objects of this class into a report generation package that calls the toString() method of each of these objects and constructs a header.
I need to override the toString() method to get rid of some extra stuff that it returns, so that my headers look clean.
What would be the best way to do this. I thought of subclassing this class, but even that is proving to be a bit painful, since I have to replicate valueOf() method for the subclass.