01: /**
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */package org.codehaus.xfire.aegis.inheritance.ws1;
19:
20: /**
21: * <br/>
22: *
23: * @author xfournet
24: */
25: public class WS1Exception extends Exception {
26: private int errorCode;
27: private Object simpleBean;
28:
29: public WS1Exception() {
30: simpleBean = null;
31: errorCode = 0;
32: }
33:
34: public WS1Exception(String message) {
35: super (message);
36: simpleBean = null;
37: errorCode = 0;
38: }
39:
40: public WS1Exception(String message, int errorCode1) {
41: super (message);
42: errorCode = errorCode1;
43: simpleBean = null;
44: }
45:
46: public WS1Exception(String message, int errorCode1, Object bean) {
47: super (message);
48: errorCode = errorCode1;
49: simpleBean = bean;
50: }
51:
52: public void setErrorCode(int errorCode) {
53: this .errorCode = errorCode;
54: }
55:
56: public void setSimpleBean(Object simpleBean) {
57: this .simpleBean = simpleBean;
58: }
59:
60: public int getErrorCode() {
61: return errorCode;
62: }
63:
64: public Object getSimpleBean() {
65: return simpleBean;
66: }
67:
68: public String toString() {
69: return "[" + getClass().getName() + "] msg=" + getMessage()
70: + "; errorCode=" + errorCode;
71: }
72:
73: public boolean equals(Object o) {
74: if (this == o) {
75: return true;
76: }
77: if (o == null || getClass() != o.getClass()) {
78: return false;
79: }
80:
81: final WS1Exception that = (WS1Exception) o;
82:
83: if (getMessage() != null ? !getMessage().equals(
84: that.getMessage()) : that.getMessage() != null) {
85: return false;
86: }
87:
88: if (errorCode != that.errorCode) {
89: return false;
90: }
91:
92: return true;
93: }
94:
95: public int hashCode() {
96: return errorCode;
97: }
98: }
|