Package com.sap.cds

Interface CdsDiffProcessor.DiffVisitor

Enclosing interface:
CdsDiffProcessor

@Beta public static interface CdsDiffProcessor.DiffVisitor
A callback, which is called by the CdsDiffProcessor on differences between two images of data.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    added(Path newPath, Path oldPath, CdsElement association, Map<String,Object> newValue)
    This method is called when the CdsDiffProcessor detects that a new entry is added to a collection of entities: a composition of many entities a cascading association to many entities the images, if the processor processes a collection of images
    default void
    changed(Path newPath, Path oldPath, CdsElement element, Object newValue, Object oldValue)
    This method is called when the CdsDiffProcessor detects a change between values of an element of an entity
    default void
    removed(Path newPath, Path oldPath, CdsElement association, Map<String,Object> oldValue)
    This method is called when the CdsDiffProcessor detects that an entry was removed from the collection of entities: a composition of many entities a cascading association to many entities the images, if the processor processes a collection of images
  • Method Details

    • changed

      default void changed(Path newPath, Path oldPath, CdsElement element, Object newValue, Object oldValue)
      This method is called when the CdsDiffProcessor detects a change between values of an element of an entity
      Parameters:
      newPath - the newPath contains the path to the element in the new image of the entity
      oldPath - the oldPath contains the path to the element in the old image state of the entity
      element - the CdsElement that represents the changed element
      newValue - the new value of the element or null if the element is removed or explicitly set to null
      oldValue - the old value of the element or null if the element is added
    • added

      default void added(Path newPath, Path oldPath, CdsElement association, Map<String,Object> newValue)
      This method is called when the CdsDiffProcessor detects that a new entry is added to a collection of entities:
      • a composition of many entities
      • a cascading association to many entities
      • the images, if the processor processes a collection of images

      The method is called for every added entry.

      Parameters:
      newPath - path to the association where the change occurs in the new image of the entity.
      oldPath - path to the association where the change occurs in the old image of the entity.
      association - the instance of the CdsElement that represents element that defines the association where change occurs.
      newValue - the content of the added entity
    • removed

      default void removed(Path newPath, Path oldPath, CdsElement association, Map<String,Object> oldValue)
      This method is called when the CdsDiffProcessor detects that an entry was removed from the collection of entities:
      • a composition of many entities
      • a cascading association to many entities
      • the images, if the processor processes a collection of images

      The method is called for every removed entry.

      Parameters:
      newPath - path to the association where the change occurs in the new image of the entity.
      oldPath - path to the association where the change occurs in the old image of the entity.
      association - the instance of the CdsElement that represents element that defines the association where change occurs.
      oldValue - the content of the removed entity