Source code: com/flexstor/common/data/ejb/address/EmailAddressData.java
1 /*
2 * EmailAddressData.java
3 *
4 * Copyright $Date: 2003/08/11 02:22:47 $ FLEXSTOR.net Inc.
5 *
6 * This work is licensed for use and distribution under license terms found at
7 * http://www.flexstor.org/license.html
8 *
9 */
10
11 package com.flexstor.common.data.ejb.address;
12
13 import com.flexstor.common.data.ejb.SettingData;
14 import com.flexstor.common.keys.ejb.EmailAddressKey;
15 import com.flexstor.common.keys.ejb.SettingKey;
16
17 /**
18 * This class supports state data for <code>EMailAddress</code>. A Data class holds <br>
19 * all of the state information for a corresponding class and reference <br>
20 * pointers to other classes <br>
21 *
22 * @author Perry Hoekstra
23 * @version 1.0, 12/19/98
24 *
25 * @since FLEXSTOR.db 3.0
26 */
27
28 public class EmailAddressData
29 extends AddressData
30 {
31
32 // MKS macro expander
33 public final static String IDENTIFIER = "$Id: EmailAddressData.java,v 1.3 2003/08/11 02:22:47 aleric Exp $";
34
35 /**
36 * Default constructor for the EmailAddressData class<p>
37 *
38 * <b>Warning</b> Any objects created with this constructor are not updatable or insertable to the database
39 */
40
41 public EmailAddressData()
42 {
43 super();
44 }
45
46 /**
47 * Constructor for the EMailAddressDataBuild class<p>
48 *
49 * <b>Warning</b> Any objects created with this constructor are not updatable (insertable, but not updatable) to the database
50 *
51 * @param java.lang.String an email address name
52 */
53
54 public EmailAddressData(EmailAddressKey key)
55 {
56 super();
57 }
58
59 /**
60 * Creates a EmailAddressData object based on an orginal EmailAddressData object.
61 * This constructor is intended to be used when duplicating this object.
62 *
63 * @param orginal the object to be copied.
64 */
65 public EmailAddressData ( EmailAddressData orginal )
66 {
67 synchronize(orginal);
68 setKey ( null );
69 }
70
71 /**
72 * Clones this object.
73 */
74 public SettingData cloneObject ( )
75 {
76 return new EmailAddressData ( this );
77 }
78
79 /**
80 * Sets the oracle key. Enforce type safety.
81 * @param the key to set
82 */
83 public void setKey(SettingKey key)
84 {
85 this.key = (EmailAddressKey)key;
86 }
87
88 /**
89 * Return the contents of the instance as a String. This method is strictly for use by testing classes <br>
90 * and should not be called by business objects
91 *
92 * @return java.lang.String - String representation of EmailAddressData contents
93 */
94
95 public String toString()
96 {
97 String t_lineSeparator = System.getProperty("line.separator", "\n");
98
99 StringBuffer t_roEMailDataContents = new StringBuffer(t_lineSeparator);
100
101 t_roEMailDataContents.append("Class: AddressData");
102 t_roEMailDataContents.append(t_lineSeparator);
103 t_roEMailDataContents.append(super.toString());
104
105 return t_roEMailDataContents.toString();
106 }
107
108 /**
109 * Return this instance's database object reference
110 *
111 * @return com.flexstor.common.keys.ejb.FtpAddressKey - an object reference to a row in the database
112 * @deprecated see getKey()
113 */
114 public EmailAddressKey getReference()
115 {
116 return (EmailAddressKey)key;
117 }
118
119 /**
120 * Return this instance's database object reference
121 *
122 * @return com.flexstor.common.keys.ejb.EmailAddressKey - an object reference to a row in the database
123 * @deprecated see setKey(EmailAddressKey aKey)
124 */
125 public void setReference(EmailAddressKey aKey)
126 {
127 setKey(aKey);
128 }
129
130 }