Record Class EmailAddress
java.lang.Object
java.lang.Record
net.tangly.core.EmailAddress
-
Constructor Summary
ConstructorsConstructorDescriptionEmailAddress(@NotNull String recipient, @NotNull String domain) Creates an instance of aEmailAddressrecord class. -
Method Summary
Modifier and TypeMethodDescription@NotNull Stringdomain()Returns the value of thedomainrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static booleanstatic EmailAddress@NotNull StringReturns the value of therecipientrecord component.text()Returns a text representation of an email address.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
EmailAddress
-
-
Method Details
-
of
-
isValid
-
text
Returns a text representation of an email address. TheObject.toString()method is not used because the implementation is defined in the API implementation of record construct. The generated string can be feed to theof(String)to create an email address object.- Returns:
- text representation
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
recipient
Returns the value of therecipientrecord component.- Returns:
- the value of the
recipientrecord component
-
domain
Returns the value of thedomainrecord component.- Returns:
- the value of the
domainrecord component
-