Package com.oracle.coherence.repository
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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classAbstractRepositoryBase.Listener.Builder<T>A builder for a simple, lambda-basedAbstractRepositoryBase.Listener.
-
Method Summary
All Methods Static Methods Instance Methods Default Methods Modifier and Type Method Description static <T> AbstractRepositoryBase.Listener.Builder<T>builder()Create newAbstractRepositoryBase.Listener.Builderinstance.default voidonInserted(T entity)An event callback that will be called when a new entity is inserted into the repository.default voidonRemoved(T entity)An event callback that will be called when an entity is removed from the repository.default voidonUpdated(T oldEntity, T newEntity)An event callback that will be called when an entity is updated.
-
-
-
Method Detail
-
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 entitynewEntity- 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()
Create newAbstractRepositoryBase.Listener.Builderinstance.- Type Parameters:
T- the entity type- Returns:
- a new
AbstractRepositoryBase.Listener.Builderinstance
-
-