2 * Copyright (C) 2016, 2017 Free Software Foundation
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 package org.mxchange.jmailee.model.delivery.wrapper;
19 import java.util.Locale;
20 import java.util.Properties;
21 import javax.mail.Address;
24 * A wrapper class for email delivery.
26 * @author Roland Häder<roland@mxchange.org>
28 public class EmailDeliveryWrapper implements WrapableEmailDelivery {
33 private static final long serialVersionUID = 518_209_689_877_185_914L;
36 * Locale instance for language
38 private Locale locale;
41 * Recipient email address
43 private Address recipientAddress;
48 private String subjectLine;
53 private String templateName;
58 private Properties templateVariables;
61 * Constructor with all required fields
63 * @param recipientAddress Recipient's email address
64 * @param subjectLine Subject line (internationalized)
65 * @param templateName Template name
66 * @param templateVariables Any template variables, at least one
67 * @param locale Recipient's locale
69 public EmailDeliveryWrapper (final Address recipientAddress, final String subjectLine, final String templateName, final Properties templateVariables, final Locale locale) {
71 this.recipientAddress = recipientAddress;
72 this.subjectLine = subjectLine;
73 this.templateName = templateName;
74 this.templateVariables = templateVariables;
79 public Locale getLocale () {
84 public void setLocale (final Locale locale) {
89 public Address getRecipientAddress () {
90 return this.recipientAddress;
94 public void setRecipientAddress (final Address recipientAddress) {
95 this.recipientAddress = recipientAddress;
99 public String getSubjectLine () {
100 return this.subjectLine;
104 public void setSubjectLine (final String subjectLine) {
105 this.subjectLine = subjectLine;
109 public String getTemplateName () {
110 return this.templateName;
114 public void setTemplateName (final String templateName) {
115 this.templateName = templateName;
119 @SuppressWarnings ("ReturnOfCollectionOrArrayField")
120 public Properties getTemplateVariables () {
121 return this.templateVariables;
125 @SuppressWarnings ("AssignmentToCollectionOrArrayFieldFromParameter")
126 public void setTemplateVariables (final Properties templateVariables) {
127 this.templateVariables = templateVariables;