You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the below class, java-object-diff is just printing. How to iterate all the changes.?
Property at path '/name' has changed from [ Tommy C. Smart ] to [
Tommy Smart ]
public class DiffTest {
public static void main(String... args) {
House h1 = new House("TN");
House h2 = new House("KA");
House h3 = new House("CLT");
House h4 = new House("MUM");
List<House> oldHouses = new ArrayList<House>();
oldHouses.add(h1);
List<House> newHouses = new ArrayList<House>();
newHouses.add(h2);
newHouses.add(h3);
newHouses.add(h1);
List<String> specializations = Arrays.asList("Maths", "Science");
List<String> specializations1 = Arrays.asList("Science", "Geography");
Address address = new Address("Bangalore");
Address address2 = new Address("Charlotte");
final Person tommyOld = new Person("tommy", "Tommy Smart", address, specializations);
final Person tommyNew = new Person("tommy", "Tommy C. Smart", address2, specializations1);
tommyOld.setMinor(true);
tommyNew.setMinor(false);
tommyNew.setWife("Amy");
tommyOld.setHouses(oldHouses);
tommyNew.setHouses(newHouses);
final ObjectDiffer objectDiffer = ObjectDifferBuilder.buildDefault();
final DiffNode root = objectDiffer.compare(tommyOld, tommyNew);
final DiffNode.Visitor visitor = new PrintingVisitor(tommyOld, tommyNew);
root.visit(visitor);
}
}
The text was updated successfully, but these errors were encountered:
In the below class, java-object-diff is just printing. How to iterate all the changes.?
The text was updated successfully, but these errors were encountered: