Replies: 4 comments 1 reply
This comment has been minimized.
This comment has been minimized.
-
Local-part propertyIt could be interesting to introduce a property Here's an example of calling this property from Kotlin code: val address: EmailAddress = requireNotNull(EmailAddress from "contact@kotools.org")
println(address.localPart) // contact |
Beta Was this translation helpful? Give feedback.
-
Factory function with customizable regular expression
For creating an Here's an example of calling the overload from Kotlin code: val address: EmailAddress? = EmailAddress.createOrNull("contact@kotools.org") {
localPart = Regex("[a-z]+") // the local part now only accepts 1 or more lowercase letters
domain = Regex("[a-z]+\.[a-z]+") // the domain now only accepts lowercase letters
// The regular expression used for validating the text input now looks like this: ^[a-z]+@[a-z]+\.[a-z]+$
}
println(address) // contact@kotools.org |
Beta Was this translation helpful? Give feedback.
-
Issues attached to #339 should be considered as the |
Beta Was this translation helpful? Give feedback.
-
Here's a curated list of tasks, associated with their first releasable version, for introducing the type
EmailAddress
, suggested by @MichaelStH in #55.Planned
EmailAddress
type #339EmailAddress
available on Java #356EmailAddress
Unplanned
EmailAddress.length
property #357EmailAddress.length
available on Java (releasable in version 5.0.0 after makingStrictlyPositiveInt
available on Java).EmailAddress.length
.EmailAddress.domain
property #358.EmailAddress.domain
available on Java.EmailAddress.domain
.EmailAddress.toNotBlankString()
function #359.EmailAddress.toNotBlankString()
available on Java (releasable in version 5.0.0 after makingNotBlankString
available on Java).EmailAddress.toNotBlankString()
.Beta Was this translation helpful? Give feedback.
All reactions