toString

override fun toString(): String

Returns the string representation of this email address.


Calling from Kotlin

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

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

Calling from Java

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

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