Entity

open class Entity<Id : EntityId<*>>(val id: Id)

Base class for domain entities.

Entities are identified by a unique id of type Id and implement equality based on their identifier. Entities are mutable objects that exist for a continuous period.

Type Parameters

Id

the type of the entity identifier (must extend EntityId).

Inheritors

Constructors

Link copied to clipboard
constructor(id: Id)

Properties

Link copied to clipboard
open val id: Id

the unique domain identifier of this entity.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Compares two Entity instances based on their identifiers.

Link copied to clipboard
open override fun hashCode(): Int

Generates a hash code based on the entity identifier.