1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
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 */
19 package org.apache.maven.plugins.pmd;
20
21 import java.util.ArrayList;
22 import java.util.List;
23
24 /**
25 * Collector of warnings and failures.
26 *
27 * @param <D> type of the check, e.g. {@link org.apache.maven.plugins.pmd.model.Violation}
28 * or {@link org.apache.maven.plugins.pmd.model.Duplication}.
29 * @author Robert Scholte
30 * @since 2.7
31 */
32 public class ViolationDetails<D> {
33 private List<D> warningDetails = new ArrayList<>();
34
35 private List<D> failureDetails = new ArrayList<>();
36
37 /**
38 * @return the warningDetails, never {@code null}
39 */
40 public List<D> getWarningDetails() {
41 return warningDetails;
42 }
43
44 /**
45 * @param warningDetails the warningDetails to set
46 */
47 public void setWarningDetails(List<D> warningDetails) {
48 this.warningDetails = warningDetails;
49 }
50
51 /**
52 * @return the failureDetails, never {@code null}
53 */
54 public List<D> getFailureDetails() {
55 return failureDetails;
56 }
57
58 /**
59 * @param failureDetails the failureDetails to set
60 */
61 public void setFailureDetails(List<D> failureDetails) {
62 this.failureDetails = failureDetails;
63 }
64 }