01: package de.schlund.pfixcore.generator;
02:
03: import de.schlund.util.statuscodes.StatusCode;
04:
05: /**
06: * Describe class StatusCodeInfo here.
07: *
08: *
09: * Created: Mon Jul 25 11:06:07 2005
10: *
11: * @author <a href="mailto:jtl@schlund.de">Jens Lautenbacher</a>
12: * @version 1.0
13: */
14: public class StatusCodeInfo {
15: private StatusCode scode;
16: private String[] args;
17: private String level;
18:
19: /**
20: * Creates a new <code>StatusCodeInfo</code> instance.
21: *
22: * @param scode a <code>StatusCode</code> value
23: */
24: public StatusCodeInfo(StatusCode scode, String[] args, String level) {
25: this .scode = scode;
26: this .args = args;
27: this .level = level;
28: }
29:
30: public StatusCode getStatusCode() {
31: return scode;
32: }
33:
34: public String[] getArgs() {
35: return args;
36: }
37:
38: public String getLevel() {
39: return level;
40: }
41:
42: public boolean equals(Object in) {
43: if (!(in instanceof StatusCodeInfo)) {
44: return false;
45: }
46: return this .hashCode() == ((StatusCodeInfo) in).hashCode();
47: }
48:
49: public String toString() {
50: StringBuffer tmp = new StringBuffer();
51: tmp.append(scode.getStatusCodeId() + "|");
52: if (args != null) {
53: for (int i = 0; i < args.length; i++) {
54: tmp.append(args[i]);
55: }
56: }
57: tmp.append("|");
58: if (level != null) {
59: tmp.append(level);
60: }
61: return tmp.toString();
62: }
63:
64: public int hashCode() {
65: return toString().hashCode();
66: }
67: }
|