# EntityChange

data class EntityChange(val entityClass: EntityClass<*, Entity<*>>, val entityId: EntityID<*>, val changeType: EntityChangeType, val transactionId: String)

Stores details about a state-change event for an Entity instance.

## Constructors

EntityChange
Link copied to clipboard
constructor(entityClass: EntityClass<*, Entity<*>>, entityId: EntityID<*>, changeType: EntityChangeType, transactionId: String)

## Properties

changeType
Link copied to clipboard
val changeType: EntityChangeType

The exact changed state of the event.

entityClass
Link copied to clipboard
val entityClass: EntityClass<*, Entity<*>>

The EntityClass of the changed entity instance.

entityId
Link copied to clipboard
val entityId: EntityID<*>

The unique EntityID associated with the entity instance.

transactionId
Link copied to clipboard
val transactionId: String

The unique id for the Transaction in which the event took place.

## Functions

toEntity
Link copied to clipboard
fun <ID : Any, T : Entity<ID>> EntityChange.toEntity(): T?

Returns the actual Entity instance associated with this event, or `null` if the entity is not found.

fun <ID : Any, T : Entity<ID>> EntityChange.toEntity(klass: EntityClass<ID, T>): T?

Returns the actual Entity instance associated with this event, or `null` if either its EntityClass type is neither equivalent to nor a subclass of klass, or if the entity is not found.