Package com.oracle.coherence.repository
Class AbstractRepositoryBase.Listener.Builder<T>
java.lang.Object
com.oracle.coherence.repository.AbstractRepositoryBase.Listener.Builder<T>
- Type Parameters:
T
- the entity type
- Enclosing interface:
AbstractRepositoryBase.Listener<T>
A builder for a simple, lambda-based
AbstractRepositoryBase.Listener
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
BuildAbstractRepositoryBase.Listener
instance.Add the event handler for all events.Add the event handler for INSERT events.Add the event handler for REMOVE events.onUpdate
(BiConsumer<T, T> eventHandler) Add the event handler for UPDATE events.Add the event handler for UPDATE events.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
build
BuildAbstractRepositoryBase.Listener
instance.- Returns:
- the
AbstractRepositoryBase.Listener
instance
-
onInsert
Add the event handler for INSERT events. The specifiedeventHandler
will receive the inserted entity as an argument when fired.- Parameters:
eventHandler
- the event handler to add- Returns:
- this
AbstractRepositoryBase.Listener.Builder
-
onUpdate
Add the event handler for UPDATE events. The specifiedeventHandler
will receive the new value of the updated entity as an argument when fired.- Parameters:
eventHandler
- the event handler to execute- Returns:
- this Listener
-
onUpdate
Add the event handler for UPDATE events. The specifiedeventHandler
will receive both the old and the new value of the updated entity as arguments when fired.- Parameters:
eventHandler
- the event handler to execute- Returns:
- this Listener
-
onRemove
Add the event handler for REMOVE events. The specifiedeventHandler
will receive the removed entity as an argument when fired.- Parameters:
eventHandler
- the event handler to execute- Returns:
- this Listener
-
onEvent
Add the event handler for all events. The specifiedeventHandler
will receive the new value of the inserted or updated entity, and the old value of the removed entity as an argument when fired.- Parameters:
eventHandler
- the event handler to execute- Returns:
- this MapListener
-