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
StaticcreateCreates an Email instance with validation.
The email address string
Success with Email or Failure with DomainError
Checks if this email belongs to a specific domain.
The domain to check
true if the email belongs to the domain
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
Returns a string representation of an object.
Represents an email address with validation.
Email is immutable and automatically normalized (trimmed and lowercased).
Example