Library to diff and merge Java objects with ease
Switch from Maven to Gradle
equals
method instead of causing an exception. #162StandardIntrospector
will now only be created when needed, so platforms like Android (where java.beans.Introspector
is not available) can easily provide alternative implementations. #158Big thanks to @jlsalmon, @scompo, @simplysoft & @PascalSchumacher for your contributions!
ObjectDiffer
throws an exceptionComparison: The ObjectDifferBuilder
now provides new configuration outlet called identity
This allows for providing a custom strategy to establish the identity of collection items base on something other than the equals method. That's especially useful when you have no control over the items equals and hashCode methods.
However, it's a brand-new feature and there may be some corner-cases that have not yet been anticipated. If you run into any trouble using this feature, please feel free to open a ticket in the issue tracker.
Many thanks to @NagyGa1 for his help on this feature.
This is just a small feature release, without any breaking changes.
Comparison: Enable ComparableComparisonStrategy for more types
Up until now this strategy only applied to BigDecimals. It has now been extended to automatically apply to all simple types that implement java.lang.Comparable
.
The list of types that qualify as simple has also been extended. It now looks as follows:
java.math.BigDecimal
java.math.BigInteger
java.lang.CharSequence
java.util.Calendar
java.util.Date
java.lang.Class
java.net.URI
java.net.URL
java.util.Locale
java.util.UUID
Of course this behaviour can be overriden via configuration API or property annotations.
To make comparison via compareTo
more reliable, from now on compareTo
will be invoked on the working
and the base
object and both will be considered equal if either one of this comparisons returns true
.
Comparison: Dates are now compared via compareTo method to workaround the strictness of java.util.Date's equals method, which only returns true for other java.util.Dates, but not for extending classes like java.sql.Date. [#85]
DiffNode: Replaced some constructors with factory methods to better express their intentions.
Utilities: Removed some unused collection utility methods.
Tests: Migrated many, many more tests from TestNG to Spock.
Tests: Upgraded to Groovy 2.3 and Spock 1.0.
DiffNode#canonicalSet
in order to create instances of missing objectsInclusionService
has been split into several InclusionResolver
scanonicalSet
now automatically creates missing objects along the path to the root objectThis version breaks API-compatibility with the previous versions, but comes with a much more powerful and intuitive configuration API and builds a strong foundation for the future of this library.
This version breaks API-compatibility with the previous versions, but comes with a much more powerful and intuitive configuration API and builds a strong foundation for the future of this library.
Until the release of the final version, I cannot guarantee, that the API won't change in some places, so please only upgrade, when you're willing to deal with that. Otherwise please stick with version 0.13.1 until then.