Class ObjectDifferBuilder

java.lang.Object
de.danielbechler.diff.ObjectDifferBuilder

public class ObjectDifferBuilder extends Object
This is the entry point of every diffing operation. It acts as a factory to get hold of an actual ObjectDiffer instance and exposes a configuration API to customize its behavior to suit your needs.
  • Method Details

    • filtering

      public FilteringConfigurer filtering()
      Allows to exclude nodes from being added to the object graph based on criteria that are only known after the diff for the affected node and all its children has been determined.
    • introspection

      public IntrospectionConfigurer introspection()
      Allows to replace the default bean introspector with a custom implementation.
    • circularReferenceHandling

      public CircularReferenceConfigurer circularReferenceHandling()
      Allows to define how the circular reference detector compares object instances.
    • inclusion

      public InclusionConfigurer inclusion()
      Allows to in- or exclude nodes based on property name, object type, category or location in the object graph.
    • comparison

      public ComparisonConfigurer comparison()
      Allows to configure the way objects are compared.
    • identity

      public IdentityService identity()
      EXPERT FEATURE: Allows to configure the way the identity of objects is determined in order to establish the relationship between different versions. By default this is done via the equals method; but sometimes that's just not possible. For example when you are dealing with generated classes or you are dealing with third-party code.

      Please keep in mind that this only alters the way this library establishes the connection between two objects. This doesn't extend to the underlying collections. So keep what in mind when you start merging your collections and weird things start to happen.

      WARNING: Personally I'd try to avoid this feature as long as possible and only use it when there is absolutely no other way.

    • categories

      public CategoryConfigurer categories()
      Allows to assign custom categories (or tags) to entire types or selected elements and properties.
    • differs

      public DifferConfigurer differs()
    • buildDefault

      public static ObjectDiffer buildDefault()
    • startBuilding

      public static ObjectDifferBuilder startBuilding()
    • build

      public ObjectDiffer build()