Interface CustomPropertyComparator<T,​C extends PropertyChange>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.util.Optional<C> compare​(T left, T right, GlobalId affectedId, Property property)
      Called by JaVers to calculate property-to-property diff between two Custom Type objects.
      boolean equals​(T a, T b)
      Called by JaVers to calculate collection-to-collection diff, when Custom Type objects are Collection items.
    • Method Detail

      • compare

        java.util.Optional<C> compare​(T left,
                                      T right,
                                      GlobalId affectedId,
                                      Property property)
        Called by JaVers to calculate property-to-property diff between two Custom Type objects.
        Parameters:
        left - left (or old) value
        right - right (or current) value
        affectedId - Id of domain object being compared
        property - property being compared
        Returns:
        should return Optional.empty() if compared objects are the same
      • equals

        boolean equals​(T a,
                       T b)
        Called by JaVers to calculate collection-to-collection diff, when Custom Type objects are Collection items.

        Both equals() and compare() should return consistent results. When compare() returns Optional.empty(), equals() should return false.