EmailAddress

@DeprecatedAsWarningSince(version = KotoolsTypesVersion.V4_5_1)
@Serializable(with = EmailAddressSerializer::class)
class EmailAddress

Deprecated

A better representation of email addresses exists in the `org.kotools.types` package. This one will be removed in v4.7.

Represents an email address.


Serialization and deserialization

The serialization and deserialization processes of this type behave like for the String type.

Here's an example of Kotlin code that encodes and decodes this type using the JavaScript Object Notation (JSON) format from kotlinx.serialization:

val address = EmailAddress("[email protected]")
val encoded: String = Json.encodeToString(address)
println(encoded) // "[email protected]"
val decoded: EmailAddress = Json.decodeFromString(encoded)
println(decoded == address) // true

Types

Link copied to clipboard
object Companion

Contains static declarations for the EmailAddress type.

Functions

Link copied to clipboard
operator override fun equals(other: Any?): Boolean

Returns true if the other object is an EmailAddress having the same string representation as this email address, or returns false otherwise.

Link copied to clipboard
override fun hashCode(): Int

Returns a hash code value for this email address.

Link copied to clipboard
override fun toString(): String

Returns the string representation of this email address.