Package io.micronaut.data.runtime.event
Class DefaultEntityEventContext<T>
java.lang.Object
io.micronaut.data.runtime.event.DefaultEntityEventContext<T>
- Type Parameters:
T
- The entity type
- All Implemented Interfaces:
EntityEventContext<T>
,PersistenceEventContext<T>
Default implementation of the
EntityEventContext
interface.- Since:
- 2.3.0
- Author:
- graemerocher
-
Constructor Summary
ConstructorDescriptionDefaultEntityEventContext
(RuntimePersistentEntity<T> persistentEntity, T entity) -
Method Summary
Modifier and TypeMethodDescription<P> void
setProperty
(io.micronaut.core.beans.BeanProperty<T, P> property, P newValue) Sets a property to its new value.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.data.event.EntityEventContext
supportsEventSystem
-
Constructor Details
-
DefaultEntityEventContext
-
-
Method Details
-
getEntity
- Specified by:
getEntity
in interfaceEntityEventContext<T>
- Returns:
- The entity associated with the event.
-
setProperty
Description copied from interface:EntityEventContext
Sets a property to its new value. If the property is immutable then the copy-constructor will be used andEntityEventContext.getEntity()
will return the updated entity.- Specified by:
setProperty
in interfaceEntityEventContext<T>
- Type Parameters:
P
- THe property type- Parameters:
property
- The propertynewValue
- The new value
-
getPersistentEntity
- Specified by:
getPersistentEntity
in interfacePersistenceEventContext<T>
- Returns:
- The
RuntimePersistentEntity
associated with the entity
-