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>
@Internal public class DefaultEntityEventContext<T> extends java.lang.Object implements EntityEventContext<T>
Default implementation of theEntityEventContextinterface.- Since:
- 2.3.0
- Author:
- graemerocher
-
-
Constructor Summary
Constructors Constructor Description DefaultEntityEventContext(RuntimePersistentEntity<T> persistentEntity, T entity)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TgetEntity()RuntimePersistentEntity<T>getPersistentEntity()<P> voidsetProperty(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 Detail
-
DefaultEntityEventContext
public DefaultEntityEventContext(RuntimePersistentEntity<T> persistentEntity, T entity)
-
-
Method Detail
-
getEntity
@NonNull public T getEntity()
- Specified by:
getEntityin interfaceEntityEventContext<T>- Returns:
- The entity associated with the event.
-
setProperty
public <P> void setProperty(io.micronaut.core.beans.BeanProperty<T,P> property, P newValue)
Description copied from interface:EntityEventContextSets 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:
setPropertyin interfaceEntityEventContext<T>- Type Parameters:
P- THe property type- Parameters:
property- The propertynewValue- The new value
-
getPersistentEntity
public RuntimePersistentEntity<T> getPersistentEntity()
- Specified by:
getPersistentEntityin interfacePersistenceEventContext<T>- Returns:
- The
RuntimePersistentEntityassociated with the entity
-
-