This project has retired. For details please refer to its Attic page.
TelephoneNumberImpl 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.UnsupportedCapabilityException;
21  import javax.xml.registry.infomodel.TelephoneNumber;
22  
23  /**
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 TelephoneNumberImpl implements TelephoneNumber
30  {
31      private String number;
32      private String type;
33  
34      public TelephoneNumberImpl()
35      {
36      }
37  
38      public String getNumber()
39      {
40          return number;
41      }
42  
43      public void setNumber(String number)
44      {
45          this.number = number;
46      }
47  
48      public String getType()
49      {
50          return type;
51      }
52  
53      public void setType(String type)
54      {
55          this.type = type;
56      }
57  
58      public String getAreaCode() throws JAXRException
59      {
60          throw new UnsupportedCapabilityException("Level 1 feature");
61      }
62  
63      public void setAreaCode(String areaCode) throws JAXRException
64      {
65          throw new UnsupportedCapabilityException("Level 1 feature");
66      }
67  
68      public String getCountryCode() throws JAXRException
69      {
70          throw new UnsupportedCapabilityException("Level 1 feature");
71      }
72  
73      public void setCountryCode(String countryCode) throws JAXRException
74      {
75          throw new UnsupportedCapabilityException("Level 1 feature");
76      }
77  
78      public String getExtension() throws JAXRException
79      {
80          throw new UnsupportedCapabilityException("Level 1 feature");
81      }
82  
83      public void setExtension(String extension) throws JAXRException
84      {
85          throw new UnsupportedCapabilityException("Level 1 feature");
86      }
87  
88      public String getUrl() throws JAXRException
89      {
90          throw new UnsupportedCapabilityException("Level 1 feature");
91      }
92  
93      public void setUrl(String url) throws JAXRException
94      {
95          throw new UnsupportedCapabilityException("Level 1 feature");
96      }
97  
98      public boolean equals(Object o)
99      {
100         if (this == o) return true;
101         if (!(o instanceof TelephoneNumberImpl)) return false;
102         final TelephoneNumberImplapache/ws/scout/registry/infomodel/TelephoneNumberImpl.html#TelephoneNumberImpl">TelephoneNumberImpl telephoneNumber = (TelephoneNumberImpl) o;
103         if (number != null ? !number.equals(telephoneNumber.number) : telephoneNumber.number != null) return false;
104         if (type != null ? !type.equals(telephoneNumber.type) : telephoneNumber.type != null) return false;
105         return true;
106     }
107 
108     public int hashCode()
109     {
110         int result;
111         result = (number != null ? number.hashCode() : 0);
112         result = 29 * result + (type != null ? type.hashCode() : 0);
113         return result;
114     }
115 
116     public String toString()
117     {
118         return number == null ? "null" : number;
119     }
120 }