Interface ChangeTransformer

All Superinterfaces:
org.springframework.core.Ordered
All Known Implementing Classes:
DefaultChangeTransformer

public interface ChangeTransformer extends org.springframework.core.Ordered
Component responsible for applying data from a ChangeDetail to a target Trackable entity.
Author:
Jeff Fischer
  • Field Summary

    Fields inherited from interface org.springframework.core.Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    applyChanges(ChangeDetail detail, Trackable target, boolean reverse, boolean addDetail, boolean validateDetailVersion, String explicitVersion)
    Apply a ChangeDetail to a target entity
    default int
     
  • Method Details

    • getOrder

      default int getOrder()
      Specified by:
      getOrder in interface org.springframework.core.Ordered
    • applyChanges

      boolean applyChanges(ChangeDetail detail, Trackable target, boolean reverse, boolean addDetail, boolean validateDetailVersion, String explicitVersion)
      Apply a ChangeDetail to a target entity
      Parameters:
      detail - The change to apply
      target - The target entity receiving the field update
      reverse - Whether to reverse and apply the detail before value, or not reverse and apply the after value
      addDetail - Whether or not the detail should be added to the details collection on the target. If you were simply running through existing details to reset values, you would not want to add the details again as you did so, for example.
      validateDetailVersion - Whether or not to check the detail version against any already applied changes for the field. This is useful if you want to make sure that an older version cannot override an already applied newer version. Primarily used during deploy.
      explicitVersion - An indicator of change state for a sandbox entity (see ChangeDetail.getVersion())
      Returns:
      Whether or not this transformer handled application of this ChangeDetail. Return false if the transformer wants to ignore a given ChangeDetail, thereby allowing another transformer to handle it.