Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class JaversTest {
- public static void main(String[] args) {
- User u1 = new User();
- User u2 = new User();
- Email e1 = new Email();
- e1.setId("id1");
- e1.setMail("Vikrant5mahajan@gmail.com");
- Email e2 = new Email();
- e2.setId("id1");
- e2.setMail("Vikrant6mahajan@gmail.com");
- u1.setEmails(Collections.singletonList(e1));
- u2.setEmails(Collections.singletonList(e2));
- Javers javers = JaversBuilder.javers().build();
- Diff diff = javers.compare(e1, e2);
- System.out.println(diff.prettyPrint());
- }
- @Data
- public static class User {
- List<Email> emails = new ArrayList<>();
- }
- @Data
- public static class Email {
- @Id
- String id;
- String mail;
- }
- }
- 1. ValueChange{globalId:'com.practo.test.api.diff.JaversTest$Email/id1', property:'mail', oldVal:'Vikrant5mahajan@gmail.com', newVal:'Vikrant6mahajan@gmail.com'}
Add Comment
Please, Sign In to add comment