]> git.mxchange.org Git - jmailer-ee.git/blob - src/org/mxchange/jmailee/model/delivery/wrapper/EmailDeliveryWrapper.java
00d0cdbe041945fd7ab144bf9e1e09edf1711fdb
[jmailer-ee.git] / src / org / mxchange / jmailee / model / delivery / wrapper / EmailDeliveryWrapper.java
1 /*
2  * Copyright (C) 2016, 2017 Free Software Foundation
3  *
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.
8  *
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.
13  *
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/>.
16  */
17 package org.mxchange.jmailee.model.delivery.wrapper;
18
19 import java.util.Locale;
20 import java.util.Properties;
21 import javax.mail.Address;
22
23 /**
24  * A wrapper class for email delivery.
25  * <p>
26  * @author Roland Häder<roland@mxchange.org>
27  */
28 public class EmailDeliveryWrapper implements WrapableEmailDelivery {
29
30         /**
31          * Serial number
32          */
33         private static final long serialVersionUID = 518_209_689_877_185_914L;
34
35         /**
36          * Locale instance for language
37          */
38         private Locale locale;
39
40         /**
41          * Recipient email address
42          */
43         private Address recipientAddress;
44
45         /**
46          * Subject line
47          */
48         private String subjectLine;
49
50         /**
51          * Template name
52          */
53         private String templateName;
54
55         /**
56          * Template variables
57          */
58         private Properties templateVariables;
59
60         /**
61          * Constructor with all required fields
62          * <p>
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
68          */
69         public EmailDeliveryWrapper (final Address recipientAddress, final String subjectLine, final String templateName, final Properties templateVariables, final Locale locale) {
70                 // Set all fields
71                 this.recipientAddress = recipientAddress;
72                 this.subjectLine = subjectLine;
73                 this.templateName = templateName;
74                 this.templateVariables = templateVariables;
75                 this.locale = locale;
76         }
77
78         @Override
79         public Locale getLocale () {
80                 return this.locale;
81         }
82
83         @Override
84         public void setLocale (final Locale locale) {
85                 this.locale = locale;
86         }
87
88         @Override
89         public Address getRecipientAddress () {
90                 return this.recipientAddress;
91         }
92
93         @Override
94         public void setRecipientAddress (final Address recipientAddress) {
95                 this.recipientAddress = recipientAddress;
96         }
97
98         @Override
99         public String getSubjectLine () {
100                 return this.subjectLine;
101         }
102
103         @Override
104         public void setSubjectLine (final String subjectLine) {
105                 this.subjectLine = subjectLine;
106         }
107
108         @Override
109         public String getTemplateName () {
110                 return this.templateName;
111         }
112
113         @Override
114         public void setTemplateName (final String templateName) {
115                 this.templateName = templateName;
116         }
117
118         @Override
119         @SuppressWarnings ("ReturnOfCollectionOrArrayField")
120         public Properties getTemplateVariables () {
121                 return this.templateVariables;
122         }
123
124         @Override
125         @SuppressWarnings ("AssignmentToCollectionOrArrayFieldFromParameter")
126         public void setTemplateVariables (final Properties templateVariables) {
127                 this.templateVariables = templateVariables;
128         }
129
130 }