001: /*
002: * Copyright 2001-2004 The Apache Software Foundation.
003: *
004: * Licensed under the Apache License, Version 2.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016:
017: package org.apache.ws.scout.registry.infomodel;
018:
019: import javax.xml.registry.JAXRException;
020: import javax.xml.registry.UnsupportedCapabilityException;
021: import javax.xml.registry.infomodel.TelephoneNumber;
022:
023: /**
024: * Implements JAXR Interface.
025: * For futher details, look into the JAXR API Javadoc.
026: *
027: * @author Anil Saldhana <anil@apache.org>
028: */
029: public class TelephoneNumberImpl implements TelephoneNumber {
030: private String number;
031: private String type;
032:
033: public TelephoneNumberImpl() {
034: }
035:
036: public String getNumber() {
037: return number;
038: }
039:
040: public void setNumber(String number) {
041: this .number = number;
042: }
043:
044: public String getType() {
045: return type;
046: }
047:
048: public void setType(String type) {
049: this .type = type;
050: }
051:
052: public String getAreaCode() throws JAXRException {
053: throw new UnsupportedCapabilityException("Level 1 feature");
054: }
055:
056: public void setAreaCode(String areaCode) throws JAXRException {
057: throw new UnsupportedCapabilityException("Level 1 feature");
058: }
059:
060: public String getCountryCode() throws JAXRException {
061: throw new UnsupportedCapabilityException("Level 1 feature");
062: }
063:
064: public void setCountryCode(String countryCode) throws JAXRException {
065: throw new UnsupportedCapabilityException("Level 1 feature");
066: }
067:
068: public String getExtension() throws JAXRException {
069: throw new UnsupportedCapabilityException("Level 1 feature");
070: }
071:
072: public void setExtension(String extension) throws JAXRException {
073: throw new UnsupportedCapabilityException("Level 1 feature");
074: }
075:
076: public String getUrl() throws JAXRException {
077: throw new UnsupportedCapabilityException("Level 1 feature");
078: }
079:
080: public void setUrl(String url) throws JAXRException {
081: throw new UnsupportedCapabilityException("Level 1 feature");
082: }
083:
084: public boolean equals(Object o) {
085: if (this == o)
086: return true;
087: if (!(o instanceof TelephoneNumberImpl))
088: return false;
089: final TelephoneNumberImpl telephoneNumber = (TelephoneNumberImpl) o;
090: if (number != null ? !number.equals(telephoneNumber.number)
091: : telephoneNumber.number != null)
092: return false;
093: if (type != null ? !type.equals(telephoneNumber.type)
094: : telephoneNumber.type != null)
095: return false;
096: return true;
097: }
098:
099: public int hashCode() {
100: int result;
101: result = (number != null ? number.hashCode() : 0);
102: result = 29 * result + (type != null ? type.hashCode() : 0);
103: return result;
104: }
105:
106: public String toString() {
107: return number == null ? "null" : number;
108: }
109: }
|