Skip to content
Snippets Groups Projects

refactor(EmailService): new EmailParameters class to be able to pass more...

Closed Nicolas.Rod requested to merge rodn-email-parameters-refacto-master into master
2 files
+ 204
30
Compare changes
  • Side-by-side
  • Inline
Files
2
/*-
* %%----------------------------------------------------------------------------------------------
* Solidify Framework - Solidify Email - EmailParameters.java
* SPDX-License-Identifier: GPL-2.0-or-later
* %----------------------------------------------------------------------------------------------%
* Copyright (C) 2017 - 2022 University of Geneva
* %----------------------------------------------------------------------------------------------%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-2.0.html>.
* ----------------------------------------------------------------------------------------------%%
*/
package ch.unige.solidify.model;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class EmailParameters {
String from;
String replyTo;
List<String> toList = new ArrayList<>();
List<String> ccList = new ArrayList<>();
List<String> bccList = new ArrayList<>();
String subject;
String body;
String template;
Map<String, Object> templateParameters = new HashMap<>();
public EmailParameters() {
}
public EmailParameters(String from, List<String> toList, String subject, String body, String template,
Map<String, Object> templateParameters) {
this.from = from;
this.toList = toList;
this.subject = subject;
this.body = body;
this.template = template;
this.templateParameters = templateParameters;
}
public String getFrom() {
return this.from;
}
public void setFrom(String from) {
this.from = from;
}
public String getReplyTo() {
return this.replyTo;
}
public void setReplyTo(String replyTo) {
this.replyTo = replyTo;
}
public List<String> getToList() {
return this.toList;
}
public void setToList(List<String> toList) {
this.toList = toList;
}
public List<String> getCcList() {
return this.ccList;
}
public List<String> addCc(List<String> ccList) {
if (ccList != null) {
this.ccList.addAll(ccList);
}
return this.ccList;
}
public void setCcList(List<String> ccList) {
this.ccList = ccList;
}
public List<String> getBccList() {
return this.bccList;
}
public List<String> addBcc(List<String> bccList) {
if (bccList != null) {
this.bccList.addAll(bccList);
}
return this.bccList;
}
public void setBccList(List<String> bccList) {
this.bccList = bccList;
}
public String getSubject() {
return this.subject;
}
public void setSubject(String subject) {
this.subject = subject;
}
public String getBody() {
return this.body;
}
public void setBody(String body) {
this.body = body;
}
public String getTemplate() {
return this.template;
}
public void setTemplate(String template) {
this.template = template;
}
public Map<String, Object> getTemplateParameters() {
return this.templateParameters;
}
public void setTemplateParameters(Map<String, Object> templateParameters) {
this.templateParameters = templateParameters;
}
}
Loading