286N/A/*
286N/A * reserved comment block
286N/A * DO NOT REMOVE OR ALTER!
286N/A */
286N/A/*
286N/A * Copyright 2004,2005 The Apache Software Foundation.
286N/A *
286N/A * Licensed under the Apache License, Version 2.0 (the "License");
286N/A * you may not use this file except in compliance with the License.
286N/A * You may obtain a copy of the License at
286N/A *
286N/A * http://www.apache.org/licenses/LICENSE-2.0
286N/A *
286N/A * Unless required by applicable law or agreed to in writing, software
286N/A * distributed under the License is distributed on an "AS IS" BASIS,
286N/A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
286N/A * See the License for the specific language governing permissions and
286N/A * limitations under the License.
286N/A */
286N/A
286N/Apackage com.sun.org.apache.xerces.internal.util;
286N/A
286N/A/**
286N/A * <p>A structure that represents an error code, characterized by
286N/A * a domain and a message key.</p>
286N/A *
286N/A * @author Naela Nissar, IBM
286N/A *
286N/A */
286N/Afinal class XMLErrorCode {
286N/A
286N/A //
286N/A // Data
286N/A //
286N/A
286N/A /** error domain **/
286N/A private String fDomain;
286N/A
286N/A /** message key **/
286N/A private String fKey;
286N/A
286N/A /**
286N/A * <p>Constructs an XMLErrorCode with the given domain and key.</p>
286N/A *
286N/A * @param domain The error domain.
286N/A * @param key The key of the error message.
286N/A */
286N/A public XMLErrorCode(String domain, String key) {
286N/A fDomain = domain;
286N/A fKey = key;
286N/A }
286N/A
286N/A /**
286N/A * <p>Convenience method to set the values of an XMLErrorCode.</p>
286N/A *
286N/A * @param domain The error domain.
286N/A * @param key The key of the error message.
286N/A */
286N/A public void setValues(String domain, String key) {
286N/A fDomain = domain;
286N/A fKey = key;
286N/A }
286N/A
286N/A /**
286N/A * <p>Indicates whether some other object is equal to this XMLErrorCode.</p>
286N/A *
286N/A * @param obj the object with which to compare.
286N/A */
286N/A public boolean equals(Object obj) {
286N/A if (!(obj instanceof XMLErrorCode))
286N/A return false;
286N/A XMLErrorCode err = (XMLErrorCode) obj;
286N/A return (fDomain.equals(err.fDomain) && fKey.equals(err.fKey));
286N/A }
286N/A
286N/A /**
286N/A * <p>Returns a hash code value for this XMLErrorCode.</p>
286N/A *
286N/A * @return a hash code value for this XMLErrorCode.
286N/A */
286N/A public int hashCode() {
286N/A return fDomain.hashCode() + fKey.hashCode();
286N/A }
286N/A}