CollectionDifference.java

  1. package no.nav.data.common.utils;

  2. import lombok.AllArgsConstructor;
  3. import lombok.Data;

  4. import java.util.Comparator;
  5. import java.util.List;

  6. /**
  7.  * See {@link StreamUtils#difference(List, List, Comparator)}
  8.  */
  9. @Data
  10. @AllArgsConstructor
  11. public class CollectionDifference<T> {

  12.     private List<T> before;
  13.     private List<T> after;

  14.     private List<T> removed;
  15.     private List<T> shared;
  16.     private List<T> added;

  17.     public String changeString() {
  18.         return "removed=" + removed + ", added=" + added;
  19.     }
  20. }