My question is about a POJO that differs in different environments, I want to get the environment value from a config table in my database, if the value is env1 the POJO will be like this:
class MyObject {
int knownField;
String myField;
}
and if the value is env2 the POJO will be like this:
class MyObject{
int knownField;
CustomObject myField;
public class CustomObject{
String value;
}
}
I found this question which may help but it will work for a situation where myField
in both POJOs have the same type. But in my question, it will have different types. How can I use the solution for my situation?