java-object-diff
java-object-diff copied to clipboard
Instance, or List of Instances, of a Class inside a Class - Creating Diff
Hi there, I have a class which has instances of other classes declared inside. An example is below:
public class Person {
public int personID;
public String personName;
public String personCode;
public Transports transports;
public Categories categories;
public List<Insurance> insurance;
}
Transports, Categories & Insurance, are an instances, or list of instances, of a class, which can include another class inside, if that makes sense?
What I would like to have done is get the difference between 2 Person classes, whilst going in to the nested classes and only returning the difference.
I hope this makes sense!
Thanks, Alex
I also have a similar requirement. Have you found a way to get it working? Without a way to find out exact difference in a particular property of 'Insurance' in the above example, the java object comparison isn't useful for me.
This feature is supported. but you should implement the interface: de.danielbechler.diff.identity.IdentityStrategy