StaticcreateStaticfromReturns the string representation of this EntityId.
Returns the JSON representation of this EntityId.
ProtectedgetReturns the components that determine equality for this Value Object. Two Value Objects are equal if all their equality components are equal.
An array of values used for equality comparison
Compares this Value Object with another for equality. Value Objects are equal if they are of the same type and all equality components match.
The other Value Object to compare with
true if the Value Objects are equal, false otherwise
Type-safe Entity ID with phantom types to prevent mixing IDs of different entity types.
The phantom type parameter T is used to make IDs type-incompatible across different entities, preventing common bugs like passing a UserId where an OrderId is expected.
Example