value_objects library
Re-exports domain value objects from gmana_value_objects.
Classes
- DateRange
- Immutable representation of a validated date range with start and end UTC DateTimes.
- DateRangeError
- Base class for date range validation errors.
- DateRangeInvalidOrder
- Error indicating that start date is after end date.
- DateRangeValidator
- Validator for date ranges.
- DateRangeValue
- Immutable domain value object representing a validated date range.
- DefaultValidationErrorMessages
- The default implementation of ValidationErrorMessages.
-
Either<
L, R> - A generic type that represents a value of one of two possible types (a disjoint union).
- A value object representing a validated email address.
- EmailBlockedDomain
- Error indicating that the email belongs to a blocked domain list.
- EmailDisposableDomain
- Error indicating that the email belongs to a disposable domain list.
- EmailDomainTooLong
- Error indicating that the domain part of the email exceeds the maximum allowed length.
- EmailEmpty
- Error indicating that the email string is empty.
- EmailError
- Base class for all email-related validation errors.
- EmailInvalidFormat
- Error indicating that the email does not match the valid format.
- EmailLocalPartTooLong
- Error indicating that the local part of the email exceeds the maximum allowed length.
- EmailTooLong
- Error indicating that the entire email exceeds the maximum allowed length.
- EmailValidationConfig
- Configuration options for email validation.
- EmailValidator
- A validator class for email addresses that conforms to an EmailValidationConfig.
- IdentifierEmpty
- Error indicating that the identifier string is empty.
- IdentifierError
- Base class for all identifier-related validation errors.
- IdentifierInvalidCreditCard
- Error indicating that the identifier is not a valid credit card.
- IdentifierInvalidEan
- Error indicating that the identifier is not a valid EAN.
- IdentifierInvalidImei
- Error indicating that the identifier is not a valid IMEI.
- IdentifierInvalidMongoId
- Error indicating that the identifier is not a valid MongoId.
- IdentifierInvalidNanoId
- Error indicating that the identifier is not a valid NanoId.
- IdentifierInvalidSemVer
- Error indicating that the identifier is not a valid SemVer.
- IdentifierInvalidUlid
- Error indicating that the identifier is not a valid ULID.
- IdentifierInvalidUuid
- Error indicating that the identifier is not a valid UUID.
- IdentifierValidationConfig
- Configuration options for identifier validation.
- IdentifierValidator
- A class responsible for validating string inputs as identifiers.
- IdentifierValue
- Immutable domain value object representing a validated identifier.
-
Left<
L, R> - Represents the failure or error side of an Either.
- Money
- A value object representing a non-negative monetary amount.
- MoneyDecimalPlacesExceeded
- Error indicating that the amount has too many fractional digits.
- MoneyEmpty
- Error indicating that the money amount is empty.
- MoneyError
- Base class for all money validation errors.
- MoneyInvalidCurrency
- Error indicating that the currency code is empty or malformed.
- MoneyInvalidFormat
- Error indicating that the money amount is not a valid decimal format.
- MoneyNegativeNotAllowed
- Error indicating that a negative money amount is disallowed.
- MoneyTooLarge
- Error indicating that the money amount is larger than the maximum allowed value.
- MoneyTooSmall
- Error indicating that the money amount is smaller than the minimum allowed value.
- MoneyUnsupportedCurrency
- Error indicating that the currency is not in the allowed currency set.
- MoneyValidationConfig
- Configuration rules for valid money values.
- MoneyValidator
- A class responsible for validating monetary inputs according to a MoneyValidationConfig.
- NetworkAddressEmpty
- Error indicating that the network address string is empty.
- NetworkAddressError
- Base class for all network address validation errors.
- NetworkAddressInvalidCidr
- Error indicating that the input is not a valid CIDR notation.
- NetworkAddressInvalidDataUri
- Error indicating that the input is not a valid Data URI.
- NetworkAddressInvalidIp
- Error indicating that the input is not a valid IP address.
- NetworkAddressInvalidMac
- Error indicating that the input is not a valid MAC address.
- NetworkAddressInvalidMagnetUri
- Error indicating that the input is not a valid Magnet URI.
- NetworkAddressInvalidPort
- Error indicating that the input is not a valid Port number.
- NetworkAddressValue
- Immutable domain value object representing a validated network address.
- NetworkValidationConfig
- Configuration options for network address validation.
- NetworkValidator
- A class responsible for validating string inputs as network addresses.
- NumberDecimalPlacesExceeded
- Error indicating that the number has too many fractional digits after the decimal point.
- NumberEmpty
- Error indicating that the number string is empty.
- NumberError
- Base class for all number validation errors.
- NumberInvalidFormat
- Error indicating that the number string is not a valid recognized format.
- NumberNegativeNotAllowed
- Error indicating that the number is negative but negative numbers are disallowed.
- NumberNotInRange
- Error indicating that the number does not fall within the required inclusive range.
- NumberNotInteger
- Error indicating that the number must be an integer, but has fractional parts.
- NumberTooLarge
- Error indicating that the number is larger than the maximum allowed value.
- NumberTooSmall
- Error indicating that the number is smaller than the minimum allowed value.
- NumberValidationConfig
- Configuration for number validation.
- NumberValidator
- A class responsible for validating string inputs as numbers according to a NumberValidationConfig.
- NumberValue
- A value object representing a validated number.
- Password
- A value object representing a validated password.
- PasswordComplexityRequired
- Error indicating that the password did not meet the required complexity score.
- PasswordEmpty
- Error indicating that the password string is empty.
- PasswordError
- Base class for all password validation errors.
- PasswordNonAscii
- Error indicating that the password contains non-ASCII characters.
- PasswordTooCommon
- Error indicating that the password is among the known list of common passwords.
- PasswordTooLong
- Error indicating that the password exceeds the maximum allowed length.
- PasswordTooPredictable
- Error indicating that the password contains predictable patterns or sequences.
- PasswordTooShort
- Error indicating that the password does not meet the minimum length requirement.
- PasswordTooWeak
- Error indicating that the password does not pass basic complexity checks.
- PasswordValidationConfig
- Configuration rules for valid passwords.
- PasswordValidator
- A class responsible for validating string inputs as passwords according to a PasswordValidationConfig.
- PhoneEmpty
- Phone input is empty.
- PhoneError
- Sealed hierarchy of phone validation errors.
- PhoneInvalidFormat
- Phone format is invalid or contains no digits.
- PhoneMissingPlus
-
Phone input is missing required
+prefix. - PhoneTooLong
- Phone number contains more than allowed maximum digits.
- PhoneTooShort
- Phone number contains fewer than required minimum digits.
- PhoneValidationConfig
- Configuration rules for phone number validation.
- PhoneValidator
- A class responsible for validating string inputs as phone numbers according to a PhoneValidationConfig.
- PhoneValue
- Immutable domain value object representing a validated phone number string.
-
Right<
L, R> -
A concrete implementation of Either that represents the successful value (
Right) in a computation. - TextContainsBlacklisted
- Error indicating that the text contains prohibited/blacklisted words.
- TextEmpty
- Error indicating that the text is empty.
- TextError
- Base class for all text-related validation errors.
- TextInvalidCharacters
- Error indicating that the text contains invalid characters not allowed by configuration.
- TextInvalidPattern
- Error indicating that the text does not match the required regular expression pattern.
- TextOnlyWhitespace
- Error indicating that the text consists entirely of whitespace.
- TextTooLong
- Error indicating that the text exceeds the maximum allowed length.
- TextTooShort
- Error indicating that the text does not meet the minimum length requirement.
- TextValidationConfig
- Configuration rules for valid text strings.
- TextValidator
- A class responsible for validating generic text inputs according to a TextValidationConfig.
- TextValue
- A value object representing a validated text string.
- UrlDisallowedScheme
- URL scheme is not allowed by configuration.
- UrlEmpty
- URL input is empty.
- UrlError
- Sealed hierarchy of URL validation errors.
- UrlInvalidFormat
- URL format is invalid or cannot be parsed.
- UrlMissingHost
- URL is missing a host address.
- UrlValidationConfig
- Configuration rules for URL validation.
- UrlValidator
- Validator for URL strings returning Either<UrlError, Uri>.
- UrlValue
- Immutable domain value object representing a validated Uri.
- ValidationError
- Base class for all validation errors. Extend this in your domain-specific error types.
- ValidationErrorMessages
- Default English messages for all validation errors. Consumers can create their own implementations for i18n.
-
ValueObject<
T> - Base class for single-value domain value objects.
Enums
- Currency
- Supported ISO 4217 currencies for ecommerce money values.
- IdentifierType
- Supported identifier validation types.
- NetworkAddressType
- Required network address type.
Extensions
-
EmailValidationAdapterX
on Either<
EmailValidationIssue, String> -
Extensions adapting
gmana_validationemail results intogmana_value_objectstypes. - EmailValidationIssueToDomainErrorX on EmailValidationIssue
- Adapts an v.EmailValidationIssue to an EmailError.
- GmanaDateRangeX on DateRange
- Inclusive interval operations for DateRange.
-
GmanaValueObjectResultX
on Either<
E, T> - Value-object validation vocabulary for an Either result.
-
IdentifierValidationAdapterX
on Either<
IdentifierValidationIssue, String> -
Extensions adapting
gmana_validationidentifier results intogmana_value_objectstypes. - IdentifierValidationIssueToDomainErrorX on IdentifierValidationIssue
- Adapts an v.IdentifierValidationIssue to an IdentifierError.
-
MoneyIterableX
on Iterable<
Money> - Helpers for summing collections of Money.
-
NetworkValidationAdapterX
on Either<
NetworkValidationIssue, String> -
Extensions adapting
gmana_validationnetwork results intogmana_value_objectstypes. - NetworkValidationIssueToDomainErrorX on NetworkValidationIssue
- Adapts a v.NetworkValidationIssue to a NetworkAddressError.
-
NumberValidationAdapterX
on Either<
NumberValidationIssue, num> -
Extensions adapting
gmana_validationnumber results intogmana_value_objectstypes. - NumberValidationIssueToDomainErrorX on NumberValidationIssue
- Adapts a v.NumberValidationIssue to a NumberError.
-
PasswordValidationAdapterX
on Either<
PasswordValidationIssue, String> -
Extensions adapting
gmana_validationpassword results intogmana_value_objectstypes. - PasswordValidationIssueToDomainErrorX on PasswordValidationIssue
- Adapts a v.PasswordValidationIssue to a PasswordError.
-
PhoneValidationAdapterX
on Either<
PhoneValidationIssue, String> -
Extensions adapting
gmana_validationphone results intogmana_value_objectstypes. - PhoneValidationIssueToDomainErrorX on PhoneValidationIssue
- Adapts a v.PhoneValidationIssue to a PhoneError.
-
TextValidationAdapterX
on Either<
TextValidationIssue, String> -
Extensions adapting
gmana_validationtext results intogmana_value_objectstypes. - TextValidationIssueToDomainErrorX on TextValidationIssue
- Adapts a v.TextValidationIssue to a TextError.
-
UrlValidationAdapterX
on Either<
UrlValidationIssue, Uri> -
Extensions adapting
gmana_validationURL results intogmana_value_objectstypes. - UrlValidationIssueToDomainErrorX on UrlValidationIssue
- Adapts a v.UrlValidationIssue to a UrlError.
Exceptions / Errors
- ValueObjectException
- Thrown when a value object's throwing constructor receives invalid input.