|
8 | 8 | import java.io.Serializable;
|
9 | 9 | import java.util.HashMap;
|
10 | 10 | import java.util.Map;
|
11 |
| -import se.bjurr.violations.lib.parsers.CPPCheckParser; |
12 | 11 | import se.bjurr.violations.lib.reports.Parser;
|
13 | 12 |
|
14 | 13 | public class Violation implements Serializable, Comparable<Violation> {
|
| 14 | + |
| 15 | + private static final long serialVersionUID = -6052921679385466168L; |
| 16 | + /** A {@link #file} used when there is no file specified in the parsed report. */ |
| 17 | + public static final String NO_FILE = "-"; |
| 18 | + /** A {@link #startLine} used when there is no line specified in the parsed report. */ |
| 19 | + public static final Integer NO_LINE = 0; |
| 20 | + |
| 21 | + private Integer column; |
| 22 | + private final Integer endLine; |
| 23 | + private final Integer endColumn; |
| 24 | + /** Also see {@link #NO_FILE} */ |
| 25 | + private final String file; |
| 26 | + |
| 27 | + private final String message; |
| 28 | + /** The algorithm, the format, used. */ |
| 29 | + private final Parser parser; |
| 30 | + /** |
| 31 | + * Intended as the tool used to find the violation. Like Detekt, when it is being used to find |
| 32 | + * violations and report them in the {@link Parser#CHECKSTYLE} format. |
| 33 | + */ |
| 34 | + private String reporter; |
| 35 | + |
| 36 | + private final String rule; |
| 37 | + private final String category; |
| 38 | + /** |
| 39 | + * Something that identifies a group that this violation belongs to. First introduced with {@link |
| 40 | + * se.bjurr.violations.lib.parsers.CPPCheckParser} to record what error tag each violation belongs |
| 41 | + * to. |
| 42 | + */ |
| 43 | + private final String group; |
| 44 | + |
| 45 | + private final SEVERITY severity; |
| 46 | + private final String source; |
| 47 | + private final Map<String, String> specifics; |
| 48 | + private final Integer startLine; |
| 49 | + |
15 | 50 | public static class ViolationBuilder {
|
16 | 51 |
|
17 | 52 | private Integer column;
|
@@ -116,44 +151,10 @@ public ViolationBuilder setGroup(final String group) {
|
116 | 151 | }
|
117 | 152 | }
|
118 | 153 |
|
119 |
| - private static final long serialVersionUID = -6052921679385466168L; |
120 |
| - /** A {@link #file} used when there is no file specified in the parsed report. */ |
121 |
| - public static final String NO_FILE = "-"; |
122 |
| - /** A {@link #startLine} used when there is no line specified in the parsed report. */ |
123 |
| - public static final Integer NO_LINE = 0; |
124 |
| - |
125 | 154 | public static ViolationBuilder violationBuilder() {
|
126 | 155 | return new ViolationBuilder();
|
127 | 156 | }
|
128 | 157 |
|
129 |
| - private Integer column; |
130 |
| - private final Integer endLine; |
131 |
| - private final Integer endColumn; |
132 |
| - /** Also see {@link #NO_FILE} */ |
133 |
| - private final String file; |
134 |
| - |
135 |
| - private final String message; |
136 |
| - /** The algorithm, the format, used. */ |
137 |
| - private final Parser parser; |
138 |
| - /** |
139 |
| - * Intended as the tool used to find the violation. Like Detekt, when it is being used to find |
140 |
| - * violations and report them in the {@link Parser#CHECKSTYLE} format. |
141 |
| - */ |
142 |
| - private String reporter; |
143 |
| - |
144 |
| - private final String rule; |
145 |
| - private final String category; |
146 |
| - /** |
147 |
| - * Something that identifies a group that this violation belongs to. First introduced with {@link |
148 |
| - * CPPCheckParser} to record what error tag each violation belongs to. |
149 |
| - */ |
150 |
| - private final String group; |
151 |
| - |
152 |
| - private final SEVERITY severity; |
153 |
| - private final String source; |
154 |
| - private final Map<String, String> specifics; |
155 |
| - private final Integer startLine; |
156 |
| - |
157 | 158 | public Violation() {
|
158 | 159 | this.startLine = null;
|
159 | 160 | this.endLine = null;
|
|
0 commit comments