View Javadoc
1   /*
2    * Cloudformation Plugin for SonarQube
3    * Copyright (C) 2019 James Pether Sörling
4    * james@hack23.com
5    *
6    * This program is free software; you can redistribute it and/or
7    * modify it under the terms of the GNU Lesser General Public
8    * License as published by the Free Software Foundation; either
9    * version 3 of the License, or (at your option) any later version.
10   *
11   * This program is distributed in the hope that it will be useful,
12   * but WITHOUT ANY WARRANTY; without even the implied warranty of
13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14   * Lesser General Public License for more details.
15   *
16   * You should have received a copy of the GNU Lesser General Public License
17   * along with this program; if not, write to the Free Software Foundation,
18   * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
19   */
20  package com.hack23.sonar.cloudformation.reports.checkov;
21  
22  import org.apache.commons.lang3.builder.EqualsBuilder;
23  import org.apache.commons.lang3.builder.HashCodeBuilder;
24  import org.apache.commons.lang3.builder.ToStringBuilder;
25  import org.apache.commons.lang3.builder.ToStringStyle;
26  
27  import com.fasterxml.jackson.annotation.JsonProperty;
28  
29  /**
30   * The Class CheckovReport.
31   */
32  public final class CheckovReport {
33  
34  	/** The check type. */
35  	private String checkType;
36  
37  	/** The summary. */
38  	private CheckovSummary summary;
39  
40  	/** The results. */
41  	private CheckovResults results;
42  
43  
44  
45  	/**
46  	 * Gets the check type.
47  	 *
48  	 * @return the check type
49  	 */
50  	@JsonProperty("check_type")
51  	public String getCheckType() {
52  		return checkType;
53  	}
54  
55  	/**
56  	 * Sets the check type.
57  	 *
58  	 * @param checkType the new check type
59  	 */
60  	public void setCheckType(final String checkType) {
61  		this.checkType = checkType;
62  	}
63  
64  	/**
65  	 * Gets the summary.
66  	 *
67  	 * @return the summary
68  	 */
69  	public CheckovSummary getSummary() {
70  		return summary;
71  	}
72  
73  	/**
74  	 * Sets the summary.
75  	 *
76  	 * @param summary the new summary
77  	 */
78  	public void setSummary(final CheckovSummary summary) {
79  		this.summary = summary;
80  	}
81  
82  	/**
83  	 * Gets the results.
84  	 *
85  	 * @return the results
86  	 */
87  	public CheckovResults getResults() {
88  		return results;
89  	}
90  
91  	/**
92  	 * Sets the results.
93  	 *
94  	 * @param results the new results
95  	 */
96  	public void setResults(final CheckovResults results) {
97  		this.results = results;
98  	}
99  
100 	/**
101 	 * To string.
102 	 *
103 	 * @return the string
104 	 */
105 	@Override
106 	public String toString() {
107 		return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
108 	}
109 
110 	/**
111 	 * Equals.
112 	 *
113 	 * @param object the object
114 	 * @return true, if successful
115 	 */
116 	@Override
117     public boolean equals(final Object object) {
118     	return EqualsBuilder.reflectionEquals(this,object);
119     }
120 
121 	/**
122 	 * Hash code.
123 	 *
124 	 * @return the int
125 	 */
126 	@Override
127 	public int hashCode() {
128 		return HashCodeBuilder.reflectionHashCode(this);
129 	}
130 
131 }