hashCode
Returns a hash code value for this regular expression.
Calling from Kotlin
Here's an example of calling this function from Kotlin code:
val hashCode: Int = EmailAddressRegex.default()
.hashCode()
val other: Int = EmailAddressRegex.default()
.hashCode()
val result: Boolean = hashCode == other
val message = "Regular expressions with the same pattern have the " +
"same hash code value."
assertTrue(result, message)
Content copied to clipboard
Calling from Java
Here's an example of calling this function from Java code:
final int hashCode = EmailAddressRegex.defaultPattern()
.hashCode();
final int other = EmailAddressRegex.defaultPattern()
.hashCode();
final boolean result = hashCode == other;
final String message = "Regular expressions with the same pattern " +
"have the same hash code value.";
Assertions.assertTrue(result, message);
Content copied to clipboard