The Diffy project
- Any object can be used despite the references dependency graph
- Finds the differences between two objects
- Returns the object's difference in an easy iterable structure
- Requires no changes to your existing class hierarchy
- Provides a simple configurable API
- No extra runtime dependencies
Using with Maven:
<dependency>
<groupId>com.wildbeeslabs.sensiblemetrics</groupId>
<artifactId>diffy</artifactId>
<version>1.1.0</version>
</dependency>
Using with Gradle:
compile 'com.wildbeeslabs.sensiblemetrics:diffy:1.1.0'
Packaging:
Package the application with all the dependencies:
mvn clean compile assembly:single
As a result represents an iterable structure of fields difference entries by any given object (custom object /fields comparators can be used if provided any).
// First object to be compared by
Object object1 = new Object();
// Last object to be compared with
Object object2 = new Object();
...
// Difference comparator instance
DiffComparator<Object> diffComparator = DefaultDiffComparatorFactory.create(Object.class);
// ResultSet of objects comparison
Iterable<DefaultDiffEntry> iterable = diffComparator.diffCompare(object1, object2);
If you discovered a bug or have just an idea for a new feature development, please don't hesitate to contact our team at Pull Request
More information regarding a contribution involvement process can be found at: here