1 | |
package org.apache.commons.contract; |
2 | |
|
3 | |
import org.apache.commons.i18n.bundles.ErrorBundle; |
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
public class Information { |
10 | |
public final static int DEBUG = 0; |
11 | |
public final static int INFO = 1; |
12 | |
public final static int WARNING = 2; |
13 | |
public final static int ERROR = 3; |
14 | |
|
15 | |
private int severity, number; |
16 | |
private ErrorBundle errorMessage; |
17 | |
private String[] involvedParameters; |
18 | |
|
19 | 0 | public Information(int severity, ErrorBundle errorMessage, String[] involvedParameters) { |
20 | 0 | this.severity = severity; |
21 | 0 | this.errorMessage = errorMessage; |
22 | 0 | this.involvedParameters = involvedParameters; |
23 | 0 | } |
24 | |
|
25 | |
public void setNumber(int number) { |
26 | 0 | this.number = number; |
27 | 0 | } |
28 | |
|
29 | |
public int getNumber() { |
30 | 0 | return number; |
31 | |
} |
32 | |
|
33 | |
public int getSeverity() { |
34 | 0 | return severity; |
35 | |
} |
36 | |
|
37 | |
public ErrorBundle getErrorBundle() { |
38 | 0 | return errorMessage; |
39 | |
} |
40 | |
|
41 | |
public String[] getInvolvedParameters() { |
42 | 0 | return involvedParameters; |
43 | |
} |
44 | |
|
45 | |
public boolean isParameterInvolved(String paramterName) { |
46 | 0 | for ( int i = 0; i < involvedParameters.length; i++ ) { |
47 | 0 | if ( involvedParameters[i].equals(paramterName) ) return true; |
48 | |
} |
49 | 0 | return false; |
50 | |
} |
51 | |
} |