KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jresearch > gossip > mail > MailMessage


1 /*
2  * $$Id: MailMessage.java,v 1.3 2005/06/07 12:32:02 bel70 Exp $$
3  *
4  * ***** BEGIN LICENSE BLOCK *****
5  * The contents of this file are subject to the Mozilla Public License
6  * Version 1.1 (the "License"); you may not use this file except in
7  * compliance with the License. You may obtain a copy of the License
8  * at http://www.mozilla.org/MPL/
9  *
10  * Software distributed under the License is distributed on an "AS IS"
11  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
12  * the License for the specific language governing rights and
13  * limitations under the License.
14  *
15  * The Original Code is JGossip forum code.
16  *
17  * The Initial Developer of the Original Code is the JResearch, Org.
18  * Portions created by the Initial Developer are Copyright (C) 2004
19  * the Initial Developer. All Rights Reserved.
20  *
21  * Contributor(s):
22  * Dmitry Belov <bel@jresearch.org>
23  *
24  * ***** END LICENSE BLOCK ***** */

25 /*
26  * Created on Oct 28, 2003
27  *
28  */

29 package org.jresearch.gossip.mail;
30
31 /**
32  * DOCUMENT ME!
33  *
34  * @author dbelov
35  */

36 public class MailMessage {
37     private String JavaDoc messagetext;
38
39     private String JavaDoc subject;
40
41     private String JavaDoc addrfrom;
42
43     private String JavaDoc namefrom;
44
45     private String JavaDoc addrto;
46
47     private String JavaDoc nameto;
48
49     /**
50      * Creates a new MailMessage object.
51      *
52      * @param messagetext
53      * DOCUMENT ME!
54      * @param subject
55      * DOCUMENT ME!
56      * @param addrfrom
57      * DOCUMENT ME!
58      * @param namefrom
59      * DOCUMENT ME!
60      * @param addrto
61      * DOCUMENT ME!
62      * @param nameto
63      * DOCUMENT ME!
64      */

65     public MailMessage(String JavaDoc messagetext, String JavaDoc subject, String JavaDoc addrfrom,
66             String JavaDoc namefrom, String JavaDoc addrto, String JavaDoc nameto) {
67         if (messagetext == null) {
68             throw new NullPointerException JavaDoc("messagetext parameter");
69         } else if (messagetext.length() < 1) {
70             throw new IllegalArgumentException JavaDoc(
71                     "messagetext parameter, value = " + messagetext);
72         }
73
74         if (subject == null) {
75             throw new NullPointerException JavaDoc("subject parameter");
76         } else if (subject.length() < 1) {
77             throw new IllegalArgumentException JavaDoc("subject parameter, value = "
78                     + subject);
79         }
80
81         if (addrfrom == null) {
82             throw new NullPointerException JavaDoc("addrfrom parameter");
83         } else if (addrfrom.length() < 1) {
84             throw new IllegalArgumentException JavaDoc("addrfrom parameter, value = "
85                     + addrfrom);
86         }
87
88         if (namefrom == null) {
89             throw new NullPointerException JavaDoc("namefrom parameter");
90         } else if (namefrom.length() < 1) {
91             throw new IllegalArgumentException JavaDoc("namefrom parameter, value = "
92                     + namefrom);
93         }
94
95         if (addrto == null) {
96             throw new NullPointerException JavaDoc("addrto parameter");
97         } else if (addrto.length() < 1) {
98             throw new IllegalArgumentException JavaDoc("addrto parameter, value = "
99                     + addrto);
100         }
101
102         if (nameto == null) {
103             throw new NullPointerException JavaDoc("nameto parameter");
104         } else if (nameto.length() < 1) {
105             throw new IllegalArgumentException JavaDoc("nameto parameter, value = "
106                     + nameto);
107         }
108
109         this.messagetext = messagetext;
110         this.subject = subject;
111         this.addrfrom = addrfrom;
112         this.namefrom = namefrom;
113         this.addrto = addrto;
114         this.nameto = nameto;
115     }
116
117     /**
118      * DOCUMENT ME!
119      *
120      * @return
121      */

122     public String JavaDoc getAddrfrom() {
123         return addrfrom;
124     }
125
126     /**
127      * DOCUMENT ME!
128      *
129      * @return
130      */

131     public String JavaDoc getAddrto() {
132         return addrto;
133     }
134
135     /**
136      * DOCUMENT ME!
137      *
138      * @return
139      */

140     public String JavaDoc getMessagetext() {
141         return messagetext;
142     }
143
144     /**
145      * DOCUMENT ME!
146      *
147      * @return
148      */

149     public String JavaDoc getNamefrom() {
150         return namefrom;
151     }
152
153     /**
154      * DOCUMENT ME!
155      *
156      * @return
157      */

158     public String JavaDoc getNameto() {
159         return nameto;
160     }
161
162     /**
163      * DOCUMENT ME!
164      *
165      * @return
166      */

167     public String JavaDoc getSubject() {
168         return subject;
169     }
170 }
171
Popular Tags