Class EmailAddressStringConverter
java.lang.Object
org.tquadrat.foundation.email.EmailAddressStringConverter
- All Implemented Interfaces:
Serializable, StringConverter<InternetAddress>
@ClassVersion(sourceVersion="$Id: EmailAddressStringConverter.java 1110 2024-03-04 15:26:06Z tquadrat $")
@API(status=STABLE,
since="0.4.2")
public final class EmailAddressStringConverter
extends Object
implements StringConverter<InternetAddress>
The implementation of
StringConverter
for an email address (implemented through
InternetAddress).
The implementation of
StringConverter.toString(Object)
uses
InternetAddress.toString()
to get the String representation of the email address.
fromString(CharSequence)
calls the constructor
InternetAddress(String).
- Author:
- Thomas Thrien (thomas.thrien@tquadrat.org)
- Version:
- $Id: EmailAddressStringConverter.java 1110 2024-03-04 15:26:06Z tquadrat $
- Since:
- 0.4.2
- See Also:
- UML Diagram
-
UML Diagram for "org.tquadrat.foundation.email.EmailAddressStringConverter"
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final EmailAddressStringConverterAn instance of this class.static final StringThe error message about an invalid email address: "\'%1$s\' is not a valid email address".Fields inherited from interface StringConverter
METHOD_NAME_GetSubjectClass, METHOD_NAME_Provider -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance ofEmailAddressStringConverter. -
Method Summary
Modifier and TypeMethodDescriptionfinal InternetAddressfromString(CharSequence source) static final EmailAddressStringConverterprovider()This method is used by theServiceLoaderto obtain the instance for thisStringConverterimplementation.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface StringConverter
toString
-
Field Details
-
MSG_InvalidEmailAddress
The error message about an invalid email address: "\'%1$s\' is not a valid email address".- See Also:
-
INSTANCE
An instance of this class.
-
-
Constructor Details
-
EmailAddressStringConverter
public EmailAddressStringConverter()Creates a new instance ofEmailAddressStringConverter.
-
-
Method Details
-
fromString
- Specified by:
fromStringin interfaceStringConverter<InternetAddress>- Throws:
IllegalArgumentException
-
provider
This method is used by theServiceLoaderto obtain the instance for thisStringConverterimplementation.- Returns:
- The instance for this
StringConverterimplementation.
-
