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 theEntityEventContext
interface.- 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 T
getEntity()
RuntimePersistentEntity<T>
getPersistentEntity()
<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 Detail
-
DefaultEntityEventContext
public DefaultEntityEventContext(RuntimePersistentEntity<T> persistentEntity, T entity)
-
-
Method Detail
-
getEntity
@NonNull public T getEntity()
- Specified by:
getEntity
in 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: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
public RuntimePersistentEntity<T> getPersistentEntity()
- Specified by:
getPersistentEntity
in interfacePersistenceEventContext<T>
- Returns:
- The
RuntimePersistentEntity
associated with the entity
-
-