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 CheckovSummary.
31   */
32  public final class CheckovSummary {
33  
34      /** The passed. */
35      private int passed;
36  
37      /** The failed. */
38      private int failed;
39  
40      /** The skipped. */
41      private int skipped;
42  
43      /** The resource count. */
44      private int resourceCount;
45  
46  	/** The parsing errors. */
47      private int parsingErrors;
48  
49      /** The checkov version. */
50      private String checkovVersion;
51  
52  
53  
54  	/**
55  	 * Gets the passed.
56  	 *
57  	 * @return the passed
58  	 */
59  	public int getPassed() {
60  		return passed;
61  	}
62  
63  	/**
64  	 * Sets the passed.
65  	 *
66  	 * @param passed the new passed
67  	 */
68  	public void setPassed(final int passed) {
69  		this.passed = passed;
70  	}
71  
72  	/**
73  	 * Gets the failed.
74  	 *
75  	 * @return the failed
76  	 */
77  	public int getFailed() {
78  		return failed;
79  	}
80  
81  	/**
82  	 * Sets the failed.
83  	 *
84  	 * @param failed the new failed
85  	 */
86  	public void setFailed(final int failed) {
87  		this.failed = failed;
88  	}
89  
90  	/**
91  	 * Gets the skipped.
92  	 *
93  	 * @return the skipped
94  	 */
95  	public int getSkipped() {
96  		return skipped;
97  	}
98  
99  	/**
100 	 * Sets the skipped.
101 	 *
102 	 * @param skipped the new skipped
103 	 */
104 	public void setSkipped(final int skipped) {
105 		this.skipped = skipped;
106 	}
107 
108 	/**
109 	 * Gets the parsing errors.
110 	 *
111 	 * @return the parsing errors
112 	 */
113 	@JsonProperty("parsing_errors")
114 	public int getParsingErrors() {
115 		return parsingErrors;
116 	}
117 
118 	/**
119 	 * Sets the parsing errors.
120 	 *
121 	 * @param parsingErrors the new parsing errors
122 	 */
123 	public void setParsingErrors(final int parsingErrors) {
124 		this.parsingErrors = parsingErrors;
125 	}
126 
127     /**
128      * Gets the resource count.
129      *
130      * @return the resource count
131      */
132 	@JsonProperty("resource_count")
133 	public int getResourceCount() {
134 		return resourceCount;
135 	}
136 
137 	/**
138 	 * Sets the resource count.
139 	 *
140 	 * @param resourceCount the new resource count
141 	 */
142 	public void setResourceCount(final int resourceCount) {
143 		this.resourceCount = resourceCount;
144 	}
145 
146 	/**
147 	 * Gets the checkov version.
148 	 *
149 	 * @return the checkov version
150 	 */
151 	@JsonProperty("checkov_version")
152 	public String getCheckovVersion() {
153 		return checkovVersion;
154 	}
155 
156 	/**
157 	 * Sets the checkov version.
158 	 *
159 	 * @param checkovVersion the new checkov version
160 	 */
161 	public void setCheckovVersion(final String checkovVersion) {
162 		this.checkovVersion = checkovVersion;
163 	}
164 
165 	/**
166 	 * To string.
167 	 *
168 	 * @return the string
169 	 */
170 	@Override
171 	public String toString() {
172 		return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
173 	}
174 
175 	/**
176 	 * Equals.
177 	 *
178 	 * @param object the object
179 	 * @return true, if successful
180 	 */
181 	@Override
182     public boolean equals(final Object object) {
183     	return EqualsBuilder.reflectionEquals(this,object);
184     }
185 
186 	/**
187 	 * Hash code.
188 	 *
189 	 * @return the int
190 	 */
191 	@Override
192 	public int hashCode() {
193 		return HashCodeBuilder.reflectionHashCode(this);
194 	}
195 
196 }