This project has retired. For details please refer to its Attic page.
EmailAddressImpl xref
View Javadoc
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  
17  package org.apache.ws.scout.registry.infomodel;
18  
19  import javax.xml.registry.JAXRException;
20  import javax.xml.registry.infomodel.EmailAddress;
21  
22  /**
23   * Implements EmailAddress
24   * * Implements JAXR Interface.
25   * For futher details, look into the JAXR API Javadoc.
26   *
27   * @author Anil Saldhana  <anil@apache.org>
28   */
29  public class EmailAddressImpl implements EmailAddress
30  {
31      private String email;
32      private String type;
33  
34      public EmailAddressImpl()
35      {
36      }
37  
38      public EmailAddressImpl(String email)
39      {
40          this.email = email;
41      }
42  
43      public EmailAddressImpl(String email, String type)
44      {
45          this.email = email;
46          this.type = type;
47      }
48  
49      public String getAddress() throws JAXRException
50      {
51          return email;
52      }
53  
54      public String getType() throws JAXRException
55      {
56          return type;
57      }
58  
59      public void setAddress(String str) throws JAXRException
60      {
61          this.email = str;
62      }
63  
64      public void setType(String str) throws JAXRException
65      {
66          this.type = str;
67      }
68  
69      public boolean equals(Object o)
70      {
71          if (this == o) return true;
72          if (!(o instanceof EmailAddressImpl)) return false;
73          final EmailAddressImpl./org/apache/ws/scout/registry/infomodel/EmailAddressImpl.html#EmailAddressImpl">EmailAddressImpl emailAddress = (EmailAddressImpl) o;
74          if (email != null ? !email.equals(emailAddress.email) : emailAddress.email != null) return false;
75          if (type != null ? !type.equals(emailAddress.type) : emailAddress.type != null) return false;
76          return true;
77      }
78  
79      public int hashCode()
80      {
81          int result;
82          result = (email != null ? email.hashCode() : 0);
83          result = 29 * result + (type != null ? type.hashCode() : 0);
84          return result;
85      }
86  
87      public String toString()
88      {
89          return email == null ? "null" : email;
90      }
91  }