-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ New EmailAddress
type in org.kotools.types
package
#635
Comments
Adds the constant property with tests, tested Kotlin and Java code samples, and dumps the Application Binary Interface (ABI).
Updates code samples tests of this function.
Adds this function in the `org.kotools.types` package with tests, tested code samples for Kotlin and Java, and documentation. Also dumps the Application Binary Interface (ABI).
Adds the `equals(Any?)` and the `hashCode()` functions to the `EmailAddress` type in the `org.kotools.types` package.
This comment was marked as resolved.
This comment was marked as resolved.
Adds module for serializing the `EmailAddress` type.
Consumers should use the `KotoolsTypesSerializers` type instead for serializing the `org.kotools.types.EmailAddress` type.
Includes the serializer of `org.kotools.types.EmailAddress` in this serializers module.
Moves these errors to the `types-internal` Gradle subproject and suffixes their name with `Error`. Also introduces an `Error` interface in the same subproject for conventioning the Application Programming Interface (API) of errors.
This function now uses the `hashCodeOf(Any, vararg Any)` function from the `types-internal` Gradle subproject. This commit also removes the `hashCodeOf` function from the `types` subproject.
A better design for creating instances of the fun EmailAddress(value: String): EmailAddress
fun EmailAddress(value: String, pattern: String): EmailAddress
fun EmailAddress.Companion.orNull(value: String): EmailAddress?
fun EmailAddress.Companion.orNull(value: String, pattern: String): EmailAddress? Here are some examples for calling these functions from Kotlin code: EmailAddress("[email protected]")
EmailAddress(" @kotools.org") // throws an exception
EmailAddress(value = "[email protected]", pattern = "^[a-z]+@[a-z]+\\.[a-z]+\$")
EmailAddress(value = " @kotools.org", pattern = "^[a-z]+@[a-z]+\\.[a-z]+\$") // throws an exception
EmailAddress(value = "[email protected]", pattern = "^[a-z]+\$") // throws an exception
EmailAddress.orNull("[email protected]")
EmailAddress.orNull(" @kotools.org") // returns null
EmailAddress.orNull(value = "[email protected]", pattern = "^[a-z]+@[a-z]+\\.[a-z]+\$")
EmailAddress.orNull(value = " @kotools.org", pattern = "^[a-z]+@[a-z]+\\.[a-z]+\$") // returns null
EmailAddress.orNull(value = "[email protected]", pattern = "^[a-z]+\$") // returns null Finally, the |
It is not possible to define another constructor without directly calling the primary one, including the check of the value against the default pattern, which is not the intended behavior when calling the factory function of |
Replaces `runCatching` function by `try catch` blocks in these samples. Ref: #635
Updates the message of the exception thrown when deserializing an `EmailAddress` from a value fails. Ref: #635
📝 Description
We want to introduce an
EmailAddress
experimental type, in theorg.kotools.types
package of thetypes
Gradle subproject, with an improved API for deprecating the same type from thekotools.types.web
package.Like the type from the
kotools.types.web
package, this new one should be serializable asString
.Finally, we want to deprecate the type from the
kotools.types.web
with a warning level, and its factory functions with an error level and replacement suggestions, for removal in v4.7.✅ Checklist
org.kotools.types
package and dump the Application Binary Interface (ABI).PATTERN
constant, test this constant, add Kotlin and Java code samples for this constant, and dump the ABI.fromStringOrNull(Any)
function with tests, code samples for Kotlin and Java, reference it in the type's documentation and dump the ABI.fromString(Any)
function with tests, code samples for Kotlin and Java, reference it in the type's documentation and dump the ABI.fromStringOrNull(Any, Any)
function with tests, code samples for Kotlin and Java, and dump the ABI.fromString(Any, Any)
function with tests, code samples for Kotlin and Java, and dump the ABI.toString
function with tests, code samples for Kotlin and Java, and dump the ABI.equals
andhashCode
) with tests, code samples for Kotlin and Java, and dump the ABI.String
with tests, Kotlin code sample and dump the ABI.EmailAddress
type from thekotools.types.web
package with a warning level, and its factory functions with an error level and replacement suggestions, for removal in v4.7. This is a source incompatible change.EmailAddress
type from thekotools.types.web
package in v4.7.KotoolsTypesSerializers.emailAddress
property for serializing this type asString
, with documentation, tests, samples, then dump the corresponding ABI.@Serializable
annotation from this type, its serialization tests and documentation, then dump the ABI.KotoolsTypesSerializers.emailAddress
module in theKotoolsTypesSerializers.all
one with tests.The text was updated successfully, but these errors were encountered: