I'm stuck with a problem of comparing objects deeply and highlighting the differences in a webpage. It has 4 domain classes, ServerTypes
, Server
, Components
& Properties
. All these are connected by beans.
Below are the code snippets of above domain classes.
class ServerTypes {
private List<Server> server;
//getters&setters
}
class Server {
private List<Components> components;
//getters & setters
}
class Components {
private List<Properties> properties;
//getters & setters
}
class Properties {
private List<String> prop;
//getters & setters
}
ServerTypes- > Server ->Components-> Properties
Beans depend on the above hierarchy. I've to loop through each property of the service class, extract the data and then compare with the ones present in a config file.
Comparison is done on all the objects of ServerTypes, Server, Components and Properties classes.
Now, coming to problem, I'm feeling difficulty in looping through each object and doing a deeper comparison and on top of this, I'm struggling to show the differences in webpage with this approach.
Is there any suggestion from talents here to do it in a sensible and easier way rather looping through each object and doing a crude comparison?
I've tried to present this in the best possible way I can. If it is still unclear, kindly let me know, I'm happy to edit the question for you.
Many Thanks in advance.