01: /*
02: * Copyright 2002 Sun Microsystems, Inc. All
03: * rights reserved. Use of this product is subject
04: * to license terms. Federal Acquisitions:
05: * Commercial Software -- Government Users
06: * Subject to Standard License Terms and
07: * Conditions.
08: *
09: * Sun, Sun Microsystems, the Sun logo, and Sun ONE
10: * are trademarks or registered trademarks of Sun Microsystems,
11: * Inc. in the United States and other countries.
12: */
13:
14: package com.sun.portal.container;
15:
16: /**
17: * ErrorCode that can be used by implementations
18: * to report back more specific information
19: * about the error.
20: **/
21: public class ErrorCode {
22:
23: private String _errorCodeKey = null;
24:
25: public ErrorCode(String errorCodeKey) {
26: if (errorCodeKey == null) {
27: throw new IllegalArgumentException("Null error code");
28: }
29: _errorCodeKey = errorCodeKey;
30: }
31:
32: public String toString() {
33: return _errorCodeKey;
34: }
35:
36: public boolean equals(Object obj) {
37: if (obj != null && (obj instanceof ErrorCode)) {
38: ErrorCode errorCodeObj = (ErrorCode) obj;
39: if (errorCodeObj._errorCodeKey.equals(this ._errorCodeKey)) {
40: return true;
41: } else {
42: return false;
43: }
44: } else {
45: return false;
46: }
47: }
48: }
|