From: Roland Häder Date: Tue, 17 May 2016 08:25:39 +0000 (+0200) Subject: moved to new location X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=11cfb1f0165fee2a0cf93ff928b993ad6afe56f7;p=jmailer-ee.git moved to new location --- diff --git a/src/org/mxchange/jmailee/model/delivery/EmailDeliveryWrapper.java b/src/org/mxchange/jmailee/model/delivery/EmailDeliveryWrapper.java deleted file mode 100644 index 6ed6153..0000000 --- a/src/org/mxchange/jmailee/model/delivery/EmailDeliveryWrapper.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright (C) 2016 Roland Haeder - * - * 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 3 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 . - */ -package org.mxchange.jmailee.model.delivery; - -import java.util.Properties; - -/** - * A wrapper class for email delivery. - *

- * @author Roland Haeder - */ -public class EmailDeliveryWrapper implements WrapableEmailDelivery { - - /** - * Serial number - */ - private static final long serialVersionUID = 518_209_689_877_185_914L; - - /** - * Body of email - */ - private String body; - - /** - * Recipient email address - */ - private String emailAddress; - - /** - * (Optional) properties - */ - private Properties[] properties; - - /** - * Subject line - */ - private String subjectLine; - - /** - * Constructor with email address (recipient), subject line, body and - * optional properties - * - * @param emailAddress Recipient's email address - * @param subjectLine Subject line - * @param body Body content - * @param properties Optional properties to e.g. override from address - */ - public EmailDeliveryWrapper (final String emailAddress, final String subjectLine, final String body, final Properties[] properties) { - // Check all except properties as they are optional - if (null == emailAddress) { - // Throw NPE - throw new NullPointerException("emailAddress is null"); //NOI18N - } else if (emailAddress.trim().isEmpty()) { - // Is empty - throw new IllegalArgumentException("emailAddress is empty"); //NOI18N - } else if (null == subjectLine) { - // Throw NPE - throw new NullPointerException("subjectLine is null"); //NOI18N - } else if (subjectLine.trim().isEmpty()) { - // Is empty - throw new IllegalArgumentException("subjectLine is empty"); //NOI18N - } else if (null == body) { - // Throw NPE - throw new NullPointerException("body is null"); //NOI18N - } else if (body.trim().isEmpty()) { - // Is empty - throw new IllegalArgumentException("body is empty"); //NOI18N - } - - // Then set all - this.emailAddress = emailAddress; - this.subjectLine = subjectLine; - this.body = body; - this.properties = properties; - } - - @Override - public String getBody () { - return this.body; - } - - @Override - public void setBody (final String body) { - this.body = body; - } - - @Override - public String getEmailAddress () { - return this.emailAddress; - } - - @Override - public void setEmailAddress (final String emailAddress) { - this.emailAddress = emailAddress; - } - - @Override - @SuppressWarnings ("ReturnOfCollectionOrArrayField") - public Properties[] getProperties () { - return this.properties; - } - - @Override - @SuppressWarnings ("AssignmentToCollectionOrArrayFieldFromParameter") - public void setProperties (final Properties[] properties) { - this.properties = properties; - } - - @Override - public String getSubjectLine () { - return this.subjectLine; - } - - @Override - public void setSubjectLine (final String subjectLine) { - this.subjectLine = subjectLine; - } - -} diff --git a/src/org/mxchange/jmailee/model/delivery/WrapableEmailDelivery.java b/src/org/mxchange/jmailee/model/delivery/WrapableEmailDelivery.java deleted file mode 100644 index 55ec556..0000000 --- a/src/org/mxchange/jmailee/model/delivery/WrapableEmailDelivery.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (C) 2016 Roland Haeder - * - * 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 3 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 . - */ -package org.mxchange.jmailee.model.delivery; - -import java.io.Serializable; -import java.util.Properties; - -/** - * A generic wrapper interface for mail delivery. - *

- * @author Roland Haeder - */ -public interface WrapableEmailDelivery extends Serializable { - - /** - * Getter for body - *

- * @return Body - */ - String getBody (); - - /** - * Setter for body - *

- * @param body Body - */ - void setBody (final String body); - - /** - * Getter for recipient's email address - *

- * @return Recipient's email address - */ - String getEmailAddress (); - - /** - * Setter for recipient's email address - *

- * @param emailAddress Recipient's email address - */ - void setEmailAddress (final String emailAddress); - - /** - * Getter for optional properties - *

- * @return Optional properties - */ - Properties[] getProperties (); - - /** - * Setter for optional properties - *

- * @param properties Optional properties - */ - void setProperties (final Properties[] properties); - - /** - * Getter for subject line - *

- * @return Subject line - */ - String getSubjectLine (); - - /** - * Setter for subject line - *

- * @param subjectLine Subject line - */ - void setSubjectLine (final String subjectLine); - -} diff --git a/src/org/mxchange/jmailee/model/delivery/wrapper/EmailDeliveryWrapper.java b/src/org/mxchange/jmailee/model/delivery/wrapper/EmailDeliveryWrapper.java new file mode 100644 index 0000000..89d4978 --- /dev/null +++ b/src/org/mxchange/jmailee/model/delivery/wrapper/EmailDeliveryWrapper.java @@ -0,0 +1,133 @@ +/* + * Copyright (C) 2016 Roland Haeder + * + * 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 3 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 . + */ +package org.mxchange.jmailee.model.delivery.wrapper; + +import java.util.Properties; + +/** + * A wrapper class for email delivery. + *

+ * @author Roland Haeder + */ +public class EmailDeliveryWrapper implements WrapableEmailDelivery { + + /** + * Serial number + */ + private static final long serialVersionUID = 518_209_689_877_185_914L; + + /** + * Body of email + */ + private String body; + + /** + * Recipient email address + */ + private String emailAddress; + + /** + * (Optional) properties + */ + private Properties[] properties; + + /** + * Subject line + */ + private String subjectLine; + + /** + * Constructor with email address (recipient), subject line, body and + * optional properties + * + * @param emailAddress Recipient's email address + * @param subjectLine Subject line + * @param body Body content + * @param properties Optional properties to e.g. override from address + */ + public EmailDeliveryWrapper (final String emailAddress, final String subjectLine, final String body, final Properties[] properties) { + // Check all except properties as they are optional + if (null == emailAddress) { + // Throw NPE + throw new NullPointerException("emailAddress is null"); //NOI18N + } else if (emailAddress.trim().isEmpty()) { + // Is empty + throw new IllegalArgumentException("emailAddress is empty"); //NOI18N + } else if (null == subjectLine) { + // Throw NPE + throw new NullPointerException("subjectLine is null"); //NOI18N + } else if (subjectLine.trim().isEmpty()) { + // Is empty + throw new IllegalArgumentException("subjectLine is empty"); //NOI18N + } else if (null == body) { + // Throw NPE + throw new NullPointerException("body is null"); //NOI18N + } else if (body.trim().isEmpty()) { + // Is empty + throw new IllegalArgumentException("body is empty"); //NOI18N + } + + // Then set all + this.emailAddress = emailAddress; + this.subjectLine = subjectLine; + this.body = body; + this.properties = properties; + } + + @Override + public String getBody () { + return this.body; + } + + @Override + public void setBody (final String body) { + this.body = body; + } + + @Override + public String getEmailAddress () { + return this.emailAddress; + } + + @Override + public void setEmailAddress (final String emailAddress) { + this.emailAddress = emailAddress; + } + + @Override + @SuppressWarnings ("ReturnOfCollectionOrArrayField") + public Properties[] getProperties () { + return this.properties; + } + + @Override + @SuppressWarnings ("AssignmentToCollectionOrArrayFieldFromParameter") + public void setProperties (final Properties[] properties) { + this.properties = properties; + } + + @Override + public String getSubjectLine () { + return this.subjectLine; + } + + @Override + public void setSubjectLine (final String subjectLine) { + this.subjectLine = subjectLine; + } + +} diff --git a/src/org/mxchange/jmailee/model/delivery/wrapper/WrapableEmailDelivery.java b/src/org/mxchange/jmailee/model/delivery/wrapper/WrapableEmailDelivery.java new file mode 100644 index 0000000..36a460e --- /dev/null +++ b/src/org/mxchange/jmailee/model/delivery/wrapper/WrapableEmailDelivery.java @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2016 Roland Haeder + * + * 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 3 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 . + */ +package org.mxchange.jmailee.model.delivery.wrapper; + +import java.io.Serializable; +import java.util.Properties; + +/** + * A generic wrapper interface for mail delivery. + *

+ * @author Roland Haeder + */ +public interface WrapableEmailDelivery extends Serializable { + + /** + * Getter for body + *

+ * @return Body + */ + String getBody (); + + /** + * Setter for body + *

+ * @param body Body + */ + void setBody (final String body); + + /** + * Getter for recipient's email address + *

+ * @return Recipient's email address + */ + String getEmailAddress (); + + /** + * Setter for recipient's email address + *

+ * @param emailAddress Recipient's email address + */ + void setEmailAddress (final String emailAddress); + + /** + * Getter for optional properties + *

+ * @return Optional properties + */ + Properties[] getProperties (); + + /** + * Setter for optional properties + *

+ * @param properties Optional properties + */ + void setProperties (final Properties[] properties); + + /** + * Getter for subject line + *

+ * @return Subject line + */ + String getSubjectLine (); + + /** + * Setter for subject line + *

+ * @param subjectLine Subject line + */ + void setSubjectLine (final String subjectLine); + +}