I want to set all String members of an object to an empty string if they are null.
Pseudocode:
foreach member in object {
if (member instanceof String and member == null) {
member = '';
}
}
What is the simplest way to achieve that?
Any framework / tool that I can use?
Write my own solution via reflection?
1 Answer