Interface AbstractRepositoryBase.Listener<T>

Type Parameters:
T - the entity type
Enclosing class:
AbstractRepositoryBase<ID,T,M>

public static interface AbstractRepositoryBase.Listener<T>
An interface that should be implemented by the clients interested in repository events.
  • Method Details

    • onInserted

      default void onInserted(T entity)
      An event callback that will be called when a new entity is inserted into the repository.
      Parameters:
      entity - inserted entity
    • onUpdated

      default void onUpdated(T oldEntity, T newEntity)
      An event callback that will be called when an entity is updated.
      Parameters:
      oldEntity - previous entity
      newEntity - new entity
    • onRemoved

      default void onRemoved(T entity)
      An event callback that will be called when an entity is removed from the repository.
      Parameters:
      entity - removed entity
    • builder

      static <T> AbstractRepositoryBase.Listener.Builder<T> builder()
      Type Parameters:
      T - the entity type
      Returns:
      a new AbstractRepositoryBase.Listener.Builder instance