Bauke Scholtz wrote:Why not making use of polymorphism?
Declare the desired method in the Loan interface and let all subclasses implement it their own way. This way you just need to invoke Loan#newAbstractMethod() instead of doing instance of and casting thing.
That's what I would have suggested if it hadn't been for the restriction in the last sentence of the original post.
Since these are passed as the input by external app I don't want to embed logic of assembling additional info in these dto type container objects.
I can't see that it would make much difference to anything, but my other solution avoids this.