All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.helger.dao.wal.IDAOChangeCallback Maven / Gradle / Ivy

The newest version!
/**
 * Copyright (C) 2014-2021 Philip Helger (www.helger.com)
 * philip[at]helger[dot]com
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.helger.dao.wal;

import java.io.Serializable;

import javax.annotation.Nonnull;

import com.helger.commons.callback.ICallback;
import com.helger.commons.id.IHasID;

/**
 * Callback interface for DAO stuff
 *
 * @author Philip Helger
 * @param 
 *        DAO manager interface type
 */
public interface IDAOChangeCallback  & Serializable> extends ICallback
{
  /**
   * Called after a new item was created.
   *
   * @param aNewItem
   *        The newly created item. Never null.
   */
  default void onCreateItem (@Nonnull final INTERFACETYPE aNewItem)
  {}

  /**
   * Called after an item was updated.
   *
   * @param aItem
   *        The updated item. Never null.
   */
  default void onUpdateItem (@Nonnull final INTERFACETYPE aItem)
  {}

  /**
   * Called after an item was removed.
   *
   * @param aItem
   *        The removed item. Never null.
   */
  default void onDeleteItem (@Nonnull final INTERFACETYPE aItem)
  {}

  /**
   * Called after an item was marked as deleted (but is still present - special
   * case of update!).
   *
   * @param aItem
   *        The item that was marked as deleted. Never null.
   */
  default void onMarkItemDeleted (@Nonnull final INTERFACETYPE aItem)
  {}

  /**
   * Called after an item was marked as undeleted.
   *
   * @param aItem
   *        The item that was marked as not deleted anymore. Never
   *        null.
   */
  default void onMarkItemUndeleted (@Nonnull final INTERFACETYPE aItem)
  {}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy