KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > services > communication > sms > model > RecipientImpl


1 /**
2  * Copyright 2001-2004 The eXo platform SARL All rights reserved.
3  * Please look at license.txt in info directory for more license detail.
4  **/

5 package org.exoplatform.services.communication.sms.model;
6
7 import java.io.Serializable JavaDoc;
8 import org.exoplatform.services.communication.sms.model.MessageStatus;
9 import org.exoplatform.services.communication.sms.model.Recipient;
10
11
12 /**
13  * @author Ove Ranheim (oranheim@yahoo.no)
14  * @since Jun 18, 2004 3:52:33 PM
15  */

16 public class RecipientImpl implements Serializable JavaDoc, Recipient {
17     
18     public static Integer JavaDoc _identity = new Integer JavaDoc(0);
19     private Integer JavaDoc _id;
20     private String JavaDoc _to;
21     private MessageStatus _status = MessageStatus.DRAFT;
22     private String JavaDoc _error = "";
23     
24     public RecipientImpl(String JavaDoc to) {
25         _to = to;
26         synchronized(_identity) {
27             int id = _identity.intValue();
28             id++;
29             _id = _identity = new Integer JavaDoc(id);
30         }
31     }
32     
33     public Integer JavaDoc getId() {
34         return _id;
35     }
36     
37     public String JavaDoc getTo() {
38         return _to;
39     }
40     
41     public Recipient setTo(String JavaDoc to) {
42         _to = to;
43         return this;
44     }
45     
46     public MessageStatus getStatus() {
47         return _status;
48     }
49
50     public Recipient setStatus(MessageStatus status) {
51         _status = status;
52         return this;
53     }
54
55     public String JavaDoc getError() {
56         return _error;
57     }
58
59     public Recipient setError(String JavaDoc error) {
60         _error = error;
61         return this;
62     }
63 }
64
65
Popular Tags