
js.email.javamail.ConverterProviderImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of js-javamail Show documentation
Show all versions of js-javamail Show documentation
Reference implementation of j(s)-email API base on JavaMail.
The newest version!
package js.email.javamail;
import java.util.HashMap;
import java.util.Map;
import javax.mail.internet.InternetAddress;
import js.converter.Converter;
import js.converter.ConverterProvider;
/**
* Provider for converters used by this email sender implementation. Converters are used to convert value types to and
* from strings representation. A value type is a class that wrap a single value susceptible to be represented as a
* single string.
*
* Current implementation provides converters for:
*
* - {@link InternetAddress}
*
- {@link MessageID}
*
*
* @author Iulian Rotaru
* @version final
*/
public class ConverterProviderImpl implements ConverterProvider
{
/**
* Get converters implemented by email sender. Returned value is map associating converter implementations to value
* types. Map key is the value type and map value is related converter implementation. A value type is a class that
* can be represented as a single value and can be converted to/from strings.
*
* @return provided converters.
*/
@Override
public Map, Class extends Converter>> getConverters()
{
Map, Class extends Converter>> converters = new HashMap<>();
converters.put(InternetAddress.class, InternetAddressConverter.class);
converters.put(MessageID.class, MessageIDConverter.class);
return converters;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy