Comparator
| src | 4 years ago | ||
| .gitignore | 5 years ago | ||
| README.md | 5 years ago | ||
| lombok.config | 5 years ago | ||
| pom.xml | 4 years ago | ||
Compare objects by annotated member variables. Non-annotated members will be ignored.
public class User {
@Comparable
private String name;
}
Instantiate
Comparator comparator = new Comparator<T>(object1, object2);
Is Equal
boolean equal = comparator.isEqual()
Differences
List<Diff> diffs = comparator.compare();
Diff
Objects other than boxed types and Strings can be marked as @Comparable.
public class User {
@Comparable
private Address address;
}
public class Address {
@Comparable
private String city;
private String state;
}