-
Notifications
You must be signed in to change notification settings - Fork 6
Closed
Description
📝 Description
We would like to introduce an experimental type named EmailAddress for all platforms with the following minimum API:
@Serializable
interface EmailAddress {
companion object {
val regex: Regex
fun create(text: String): EmailAddress
fun createOrNull(text: String): EmailAddress?
}
override fun equals(other: Any?): Boolean
override fun hashCode(): Int
override fun toString(): String
}This type should be serializable as String.
Being experimental, the properties and functions of this type shouldn't be available yet for Java users.
✅ Checklist
- Add type with the declarations of
Companionand the functiontoString(), test them, update the public API binaries and the unreleased changelog. - Override the functions
equals(Any?)andhashCode(), test them and update public API binaries. - Make the type serializable, test its serialization and deserialization, then update the public API binaries.
- Create an issue for making the declarations of this type available for Java users in the next patch release.
- Create an issue for adding an experimental property
length: StrictlyPositiveIntto this type. - Create an issue template for introducing an experimental declaration. There is no need to attach this issue to the corresponding commit.
- Create an issue for adding an experimental property
domain: WebDomainto this type. - Create an issue for adding an experimental function
toNotBlankString(): NotBlankStringto this type. - Treat all comments of this issue.
- Resolve comment ✨ New
EmailAddresstype #339 (comment). - Resolve comment ✨ New
EmailAddresstype #339 (comment). - Resolve comment ✨ New
EmailAddresstype #339 (comment). - Resolve comment ✨ New
EmailAddresstype #339 (comment). - Remove the
JvmFieldannotation on theEmailAddress.Companion.regexproperty. - Refactor the serializer of this type (hint: centralize the serialization as
String). - Apply these changes to the
release/4.4.0branch. - Close this issue and update the status of tracking issues.