1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.juddi.datatype;
17
18
19 /***
20 * Holds email address, can be adorned with an optinal useType attribute. If more than
21 * one Email element is saved within the same contact then the useType must be supplied.
22 *
23 * The useType attribute is used to describe the type of the email address in freeform text.
24 * Examples are "technical questions", "sales contact", etc.
25 *
26 * @author Steve Viens (sviens@apache.org)
27 */
28 public class Email implements RegistryObject
29 {
30 String value;
31 String useType;
32
33 /***
34 * Construct a new initialized Email instance.
35 */
36 public Email()
37 {
38 }
39
40 /***
41 * Construct a new Email with a given address.
42 *
43 * @param email The address of the email.
44 */
45 public Email(String email)
46 {
47 this.value = email;
48 }
49
50 /***
51 * Construct a new Email with a given address and given usetype.
52 *
53 * @param email The address of the email.
54 * @param type The usetype of the email.
55 */
56 public Email(String email, String type)
57 {
58 this.value = email;
59 this.useType = type;
60 }
61
62 /***
63 * Sets the emailAddress of the Email to the given address.
64 *
65 * @param email The new address of this email.
66 */
67 public void setValue(String email)
68 {
69 this.value = email;
70 }
71
72 /***
73 * Returns the emailAddress of this Email.
74 *
75 * @return The emailAddress of this Email.
76 */
77 public String getValue()
78 {
79 return this.value;
80 }
81
82 /***
83 * Sets the usetype of this Email to the given usetype. If the new usetype is
84 * null, this Email doesn't have a usetype anymore.
85 *
86 * @param type The new usetype of this Email, or null if this Email doesn't
87 * have an usetype anymore.
88 */
89 public void setUseType(String type)
90 {
91 this.useType = type;
92 }
93
94 /***
95 * Returns the usetype of this Email.
96 *
97 * @return The usetype of this Email, or null if this Email doesn't have
98 * an usetype.
99 */
100 public String getUseType()
101 {
102 return this.useType;
103 }
104 }