toString

override fun toString(): String

Returns the string representation of this email address.


Calling from Kotlin

Here's an example of calling this function from Kotlin code:

val text: Any = "[email protected]"
val address: EmailAddress = EmailAddress.fromString(text)
val actual = "$address" // or address.toString()
assertEquals(expected = text, actual)

Calling from Java

Here's an example of calling this function from Java code:

final Object text = "[email protected]";
final EmailAddress address = EmailAddress.fromString(text);
final String actual = address.toString();
Assertions.assertEquals(text, actual);