toString
Returns the string representation of this email address.
Calling from Kotlin
Here's an example of calling this function from Kotlin code:
val text = "[email protected]"
val emailAddress: EmailAddress = EmailAddress.of(text) ?: fail()
val result = "$emailAddress" // or emailAddress.toString()
assertEquals(expected = text, result)Content copied to clipboard
Calling from Java
Here's an example of calling this function from Java code:
final String text = "[email protected]";
final EmailAddress address = EmailAddress.of(text);
Assertions.assertNotNull(address);
final String actual = address.toString();
Assertions.assertEquals(text, actual);Content copied to clipboard