Companion

object Companion

Contains static declarations for the EmailAddress type.

Functions

Link copied to clipboard
@ExperimentalSince(version = KotoolsTypesVersion.V5_1_0)
infix fun of(text: String): EmailAddress?

Returns an email address with the specified text, or returns null if the text doesn't match EmailAddressRegex.Companion.default.

@ExperimentalSince(version = KotoolsTypesVersion.V5_1_0)
fun of(text: String, regex: EmailAddressRegex): EmailAddress?

Returns an email address with the specified text, or returns null if the text doesn't match the specified regex.

Link copied to clipboard
@DeprecatedAsErrorSince(version = KotoolsTypesVersion.V5_1_0)
@ExperimentalSince(version = KotoolsTypesVersion.V4_5_3)
fun orNull(text: String): EmailAddress?

Creates an instance of EmailAddress from the specified text, or returns null if the text doesn't match the default regular expression.

@DeprecatedAsErrorSince(version = KotoolsTypesVersion.V5_1_0)
@ExperimentalSince(version = KotoolsTypesVersion.V5_0_1)
fun orNull(text: String, regex: EmailAddressRegex): EmailAddress?

Returns an email address from the specified text, or returns null if the text doesn't match the specified regex.

Link copied to clipboard
@DeprecatedAsErrorSince(version = KotoolsTypesVersion.V5_1_0)
@ExperimentalSince(version = KotoolsTypesVersion.V4_5_3)
fun orThrow(text: String): EmailAddress

Creates an instance of EmailAddress from the specified text, or throws an IllegalArgumentException if the text doesn't match the default regular expression.

@DeprecatedAsErrorSince(version = KotoolsTypesVersion.V5_1_0)
@ExperimentalSince(version = KotoolsTypesVersion.V5_0_1)
fun orThrow(text: String, regex: EmailAddressRegex): EmailAddress

Returns an email address from the specified text, or throws an IllegalArgumentException if the text doesn't match the specified regex.