KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > juddi > datatype > publisher > Publisher


1 /*
2  * Copyright 2001-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.juddi.datatype.publisher;
17
18 import org.apache.juddi.datatype.Name;
19 import org.apache.juddi.datatype.RegistryObject;
20
21 /**
22  * @author Steve Viens (sviens@apache.org)
23  */

24 public class Publisher implements RegistryObject
25 {
26   private String JavaDoc publisherID;
27   private String JavaDoc nameValue;
28   private String JavaDoc emailAddress;
29   private boolean admin;
30   private boolean enabled;
31
32   /**
33    *
34    */

35   public Publisher()
36   {
37   }
38
39   /**
40    *
41    */

42   public Publisher(String JavaDoc pubID,String JavaDoc name)
43   {
44     this.publisherID = pubID;
45     this.nameValue = name;
46   }
47
48   /**
49    *
50    */

51   public Publisher(String JavaDoc pubID,String JavaDoc name,boolean adminValue)
52   {
53     this(pubID,name);
54     this.admin = adminValue;
55   }
56
57   /**
58    *
59    */

60   public void setPublisherID(String JavaDoc pubID)
61   {
62     this.publisherID = pubID;
63   }
64
65   /**
66    *
67    */

68   public String JavaDoc getPublisherID()
69   {
70     return this.publisherID;
71   }
72
73   /**
74    * Sets the name of this Publisher to the given name.
75    *
76    * @param name The new name of this Publisher.
77    */

78   public void setName(String JavaDoc name)
79   {
80     this.nameValue = name;
81   }
82
83   /**
84    * Returns the name of this Publisher as a String.
85    *
86    * @return The name of this Publisher.
87    */

88   public String JavaDoc getName()
89   {
90     return this.nameValue;
91   }
92
93   /**
94     * Sets the name of this Publisher to the given name.
95     *
96     * @param name The new name of this Publisher.
97     */

98   public void setName(Name name)
99   {
100     if (name != null)
101       this.nameValue = name.getValue();
102     else
103       this.nameValue = null;
104   }
105
106   /**
107    *
108    */

109   public void setEmailAddress(String JavaDoc email)
110   {
111     this.emailAddress = email;
112   }
113
114   /**
115    *
116    */

117   public String JavaDoc getEmailAddress()
118   {
119     return this.emailAddress;
120   }
121
122   /**
123    *
124    */

125   public void setAdmin(boolean adminValue)
126   {
127     this.admin = adminValue;
128   }
129
130   /**
131    *
132    */

133   public void setAdminValue(String JavaDoc adminValue)
134   {
135     if (adminValue == null)
136       this.admin = false;
137     else
138       this.admin = (adminValue.equalsIgnoreCase("true"));
139   }
140
141   /**
142    *
143    */

144   public boolean isAdmin()
145   {
146     return this.admin;
147   }
148
149
150   /**
151    *
152    */

153   public void setEnabled(boolean enabledValue)
154   {
155     this.enabled = enabledValue;
156   }
157
158   /**
159    *
160    */

161   public void setEnabledValue(String JavaDoc enabledValue)
162   {
163     if (enabledValue == null)
164       this.enabled = false;
165     else
166       this.enabled = (enabledValue.equalsIgnoreCase("true"));
167   }
168
169   /**
170    *
171    */

172   public boolean isEnabled()
173   {
174     return this.enabled;
175   }
176
177
178   /***************************************************************************/
179   /***************************** TEST DRIVER *********************************/
180   /***************************************************************************/
181
182
183   // test-driver
184
public static void main(String JavaDoc[] args)
185   {
186   }
187 }
Popular Tags