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 telephone nbrs, can be adorned with an optinal useType attribute. If
21 * more than one Phone element is saved (in a Contacts.Phone[] ) then the
22 * useType must be supplied.
23 *
24 * @author Steve Viens (sviens@apache.org)
25 */
26 public class Phone implements RegistryObject
27 {
28 String phoneNumber;
29 String useType;
30
31 /***
32 * Construct a new initialized Phone instance.
33 */
34 public Phone()
35 {
36 }
37
38 /***
39 * Construct a new phone with a given phone-number.
40 *
41 * @param number The number of the new phone.
42 */
43 public Phone(String number)
44 {
45 this.phoneNumber = number;
46 }
47
48 /***
49 * Construct a new phone with a given phone-number and usetype.
50 *
51 * @param number The number of the new phone.
52 * @param useType The usetype of the new phone.
53 */
54 public Phone(String number, String useType)
55 {
56 this.phoneNumber = number;
57 this.useType = useType;
58 }
59
60 /***
61 * Sets the number of this Phone to the given number.
62 *
63 * @param number The new number of this phone.
64 */
65 public void setValue(String number)
66 {
67 this.phoneNumber = number;
68 }
69
70 /***
71 * Returns the number of this Phone.
72 *
73 * @return The number of this Phone.
74 */
75 public String getValue()
76 {
77 return this.phoneNumber;
78 }
79
80 /***
81 * Sets the UseType of this Phone to the given UseType. If this Phone
82 * doesn't have a UseType anymore, then the new usetype must be null.
83 *
84 * @param type The new UseType of this Phone.
85 */
86 public void setUseType(String type)
87 {
88 this.useType = type;
89 }
90
91 /***
92 * Returns the UseType of this Phone.
93 *
94 * @return The UseType of this Phone, or null if this Phone doesn't have
95 * an UseType.
96 */
97 public String getUseType()
98 {
99 return this.useType;
100 }
101 }