3 * Copyright (C) 2009-2022 SonarSource SA
4 * mailto:info AT sonarsource DOT com
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.
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.
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.
20 package org.sonar.server.issue.index;
22 import java.util.List;
23 import java.util.Optional;
24 import java.util.OptionalInt;
25 import javax.annotation.Nullable;
27 public class SecurityStandardCategoryStatistics {
29 private final String category;
30 private final long vulnerabilities;
31 private final OptionalInt vulnerabilityRating;
32 private final long toReviewSecurityHotspots;
33 private final long reviewedSecurityHotspots;
34 private final Integer securityReviewRating;
35 private final List<SecurityStandardCategoryStatistics> children;
36 private long activeRules;
37 private long totalRules;
38 private boolean hasMoreRules;
39 private final Optional<String> version;
41 public SecurityStandardCategoryStatistics(String category, long vulnerabilities, OptionalInt vulnerabiliyRating, long toReviewSecurityHotspots,
42 long reviewedSecurityHotspots, Integer securityReviewRating, @Nullable List<SecurityStandardCategoryStatistics> children, @Nullable String version) {
43 this.category = category;
44 this.vulnerabilities = vulnerabilities;
45 this.vulnerabilityRating = vulnerabiliyRating;
46 this.toReviewSecurityHotspots = toReviewSecurityHotspots;
47 this.reviewedSecurityHotspots = reviewedSecurityHotspots;
48 this.securityReviewRating = securityReviewRating;
49 this.children = children;
50 this.version = Optional.ofNullable(version);
51 this.hasMoreRules = false;
54 public String getCategory() {
58 public long getVulnerabilities() {
59 return vulnerabilities;
62 public OptionalInt getVulnerabilityRating() {
63 return vulnerabilityRating;
66 public long getToReviewSecurityHotspots() {
67 return toReviewSecurityHotspots;
70 public long getReviewedSecurityHotspots() {
71 return reviewedSecurityHotspots;
74 public Integer getSecurityReviewRating() {
75 return securityReviewRating;
78 public List<SecurityStandardCategoryStatistics> getChildren() {
82 public long getActiveRules() {
86 public SecurityStandardCategoryStatistics setActiveRules(long activeRules) {
87 this.activeRules = activeRules;
91 public long getTotalRules() {
95 public Optional<String> getVersion() {
99 public SecurityStandardCategoryStatistics setTotalRules(long totalRules) {
100 this.totalRules = totalRules;
104 public boolean hasMoreRules() {
108 public void setHasMoreRules(boolean hasMoreRules) {
109 this.hasMoreRules = hasMoreRules;