-
Notifications
You must be signed in to change notification settings - Fork 2
Home
This little framework was born out of the need to be able to log create and update operations on entities in order to bring visibility into the behaviour of an application. It is based on the java-diff-utils in such that it will generate a unified diff with no contextual lines.
This framework allows to compare any two Java objects. Aside from the actual diff algorithm, diffing two Java objects basically comes down to two problems:
The java-diff-utils framework works with lists of strings. A list of strings represents a document. In order to create a document out of a Java object it needs to be serialized and the serialization must produce a human readable output. This framework allows to specify custom serializers which are used to serialize objects in the to be diffed object graph. The set of properties that will be diffed on each object in the graph is defined through the readable properties on these objects. A readable property is a bean property that has a public getter.
There are certain Java structures (e.g. HashMap
, HashSet
) which do not define order. To produce consistent diff results one needs to make sure that unordered structures are ordered before serialization. The framework allows to specify comparators or comparables which are used to order Iterable
and Map
objects.
More details about usage.
[Usage](https://github.com/codereligion/diff/wiki/Usage)
[FAQ](https://github.com/codereligion/diff/wiki/FAQ)