hashCode
Returns a hash code value for this email address.
Calling from Kotlin
Here's an example of calling this function from Kotlin code:
val value = "contact@kotools.org"
val first: Int = EmailAddress(value)
.hashCode()
val second: Int = EmailAddress(value)
.hashCode()
val result: Boolean = first == second
println(result) // true
Content copied to clipboard
Calling from Java
Here's an example of calling this function from Java code:
final String value = "contact@kotools.org";
final EmailAddress first = new EmailAddress(value);
final EmailAddress second = new EmailAddress(value);
final int firstHashCode = first.hashCode();
final int secondHashCode = second.hashCode();
final boolean result = firstHashCode == secondHashCode;
System.out.println(result); // true
Content copied to clipboard