Class EntityMergeHooker

java.lang.Object
net.datenwerke.rs.utils.entitymerge.service.hooker.EntityMergeHooker
All Implemented Interfaces:
Hook, EntityMergeHook
Direct Known Subclasses:
DashboardDefaultMergeHooker, DatasinkDefaultMergeHooker, DatasourceDefaultMergeHooker, FileServerDefaultMergeHooker, ReportDefaultMergeHooker

public abstract class EntityMergeHooker extends Object implements EntityMergeHook
  • Constructor Details

    • EntityMergeHooker

      public EntityMergeHooker(Class<?> targetClazz, <any> cloneService)
  • Method Details

    • consumes

      public boolean consumes(Object oldInstance, Object newInstance)
      Evaluates if the hook should apply to the supplied objects. Should only return true if both are of type targetClazz
      Specified by:
      consumes in interface EntityMergeHook
      Parameters:
      oldInstance - the object to be merged
      newInstance - the object with the target values
      Returns:
      true if merge is possible otherwise false
    • mergeEntity

      public void mergeEntity(Object oldInstance, Object newInstance) throws IllegalAccessException
      Description copied from interface: EntityMergeHook
      Performs the merge of two entities
      Specified by:
      mergeEntity in interface EntityMergeHook
      Parameters:
      oldInstance - the object to be merged
      newInstance - the object with the target values
      Throws:
      IllegalAccessException - if the merging of fields failed