Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

IndexedIssueDto.java 7.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  1. /*
  2. * SonarQube
  3. * Copyright (C) 2009-2023 SonarSource SA
  4. * mailto:info AT sonarsource DOT 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 org.sonar.db.issue;
  21. import java.util.Collections;
  22. import java.util.EnumMap;
  23. import java.util.HashSet;
  24. import java.util.Map;
  25. import java.util.Set;
  26. import org.sonar.api.issue.impact.Severity;
  27. import org.sonar.api.issue.impact.SoftwareQuality;
  28. public final class IndexedIssueDto {
  29. private String issueKey = null;
  30. private String assignee = null;
  31. private Integer line = null;
  32. private String resolution = null;
  33. private String cleanCodeAttribute = null;
  34. private String severity = null;
  35. private String status = null;
  36. private Long effort = null;
  37. private String authorLogin = null;
  38. private Long issueCloseDate = null;
  39. private Long issueCreationDate = null;
  40. private Long issueUpdateDate = null;
  41. private String ruleUuid = null;
  42. private String language = null;
  43. private String componentUuid = null;
  44. private String path = null;
  45. private String scope = null;
  46. private String branchUuid = null;
  47. private boolean isMain = false;
  48. private String projectUuid = null;
  49. private String tags = null;
  50. private Integer issueType = null;
  51. private String securityStandards = null;
  52. private String qualifier = null;
  53. private boolean isNewCodeReferenceIssue = false;
  54. private String codeVariants = null;
  55. private Set<ImpactDto> impacts = new HashSet<>();
  56. private Set<ImpactDto> ruleDefaultImpacts = new HashSet<>();
  57. public IndexedIssueDto() {
  58. // empty constructor
  59. }
  60. public String getIssueKey() {
  61. return issueKey;
  62. }
  63. public IndexedIssueDto setIssueKey(String issueKey) {
  64. this.issueKey = issueKey;
  65. return this;
  66. }
  67. public String getAssignee() {
  68. return assignee;
  69. }
  70. public IndexedIssueDto setAssignee(String assignee) {
  71. this.assignee = assignee;
  72. return this;
  73. }
  74. public Integer getLine() {
  75. return line;
  76. }
  77. public IndexedIssueDto setLine(Integer line) {
  78. this.line = line;
  79. return this;
  80. }
  81. public String getResolution() {
  82. return resolution;
  83. }
  84. public IndexedIssueDto setResolution(String resolution) {
  85. this.resolution = resolution;
  86. return this;
  87. }
  88. public String getSeverity() {
  89. return severity;
  90. }
  91. public IndexedIssueDto setSeverity(String severity) {
  92. this.severity = severity;
  93. return this;
  94. }
  95. public String getStatus() {
  96. return status;
  97. }
  98. public IndexedIssueDto setStatus(String status) {
  99. this.status = status;
  100. return this;
  101. }
  102. public Long getEffort() {
  103. return effort;
  104. }
  105. public IndexedIssueDto setEffort(Long effort) {
  106. this.effort = effort;
  107. return this;
  108. }
  109. public String getAuthorLogin() {
  110. return authorLogin;
  111. }
  112. public IndexedIssueDto setAuthorLogin(String authorLogin) {
  113. this.authorLogin = authorLogin;
  114. return this;
  115. }
  116. public Long getIssueCloseDate() {
  117. return issueCloseDate;
  118. }
  119. public IndexedIssueDto setIssueCloseDate(Long issueCloseDate) {
  120. this.issueCloseDate = issueCloseDate;
  121. return this;
  122. }
  123. public Long getIssueCreationDate() {
  124. return issueCreationDate;
  125. }
  126. public IndexedIssueDto setIssueCreationDate(Long issueCreationDate) {
  127. this.issueCreationDate = issueCreationDate;
  128. return this;
  129. }
  130. public Long getIssueUpdateDate() {
  131. return issueUpdateDate;
  132. }
  133. public IndexedIssueDto setIssueUpdateDate(Long issueUpdateDate) {
  134. this.issueUpdateDate = issueUpdateDate;
  135. return this;
  136. }
  137. public String getRuleUuid() {
  138. return ruleUuid;
  139. }
  140. public IndexedIssueDto setRuleUuid(String ruleUuid) {
  141. this.ruleUuid = ruleUuid;
  142. return this;
  143. }
  144. public String getLanguage() {
  145. return language;
  146. }
  147. public IndexedIssueDto setLanguage(String language) {
  148. this.language = language;
  149. return this;
  150. }
  151. public String getComponentUuid() {
  152. return componentUuid;
  153. }
  154. public IndexedIssueDto setComponentUuid(String componentUuid) {
  155. this.componentUuid = componentUuid;
  156. return this;
  157. }
  158. public String getPath() {
  159. return path;
  160. }
  161. public IndexedIssueDto setPath(String path) {
  162. this.path = path;
  163. return this;
  164. }
  165. public String getScope() {
  166. return scope;
  167. }
  168. public IndexedIssueDto setScope(String scope) {
  169. this.scope = scope;
  170. return this;
  171. }
  172. public String getBranchUuid() {
  173. return branchUuid;
  174. }
  175. public IndexedIssueDto setBranchUuid(String branchUuid) {
  176. this.branchUuid = branchUuid;
  177. return this;
  178. }
  179. public boolean isMain() {
  180. return isMain;
  181. }
  182. public IndexedIssueDto setIsMain(boolean isMain) {
  183. this.isMain = isMain;
  184. return this;
  185. }
  186. public String getProjectUuid() {
  187. return projectUuid;
  188. }
  189. public IndexedIssueDto setProjectUuid(String projectUuid) {
  190. this.projectUuid = projectUuid;
  191. return this;
  192. }
  193. public String getTags() {
  194. return tags;
  195. }
  196. public IndexedIssueDto setTags(String tags) {
  197. this.tags = tags;
  198. return this;
  199. }
  200. @Deprecated
  201. public Integer getIssueType() {
  202. return issueType;
  203. }
  204. @Deprecated
  205. public IndexedIssueDto setIssueType(Integer issueType) {
  206. this.issueType = issueType;
  207. return this;
  208. }
  209. public String getSecurityStandards() {
  210. return securityStandards;
  211. }
  212. public IndexedIssueDto setSecurityStandards(String securityStandards) {
  213. this.securityStandards = securityStandards;
  214. return this;
  215. }
  216. public String getQualifier() {
  217. return qualifier;
  218. }
  219. public IndexedIssueDto setQualifier(String qualifier) {
  220. this.qualifier = qualifier;
  221. return this;
  222. }
  223. public boolean isNewCodeReferenceIssue() {
  224. return isNewCodeReferenceIssue;
  225. }
  226. public IndexedIssueDto setNewCodeReferenceIssue(boolean newCodeReferenceIssue) {
  227. isNewCodeReferenceIssue = newCodeReferenceIssue;
  228. return this;
  229. }
  230. public String getCodeVariants() {
  231. return codeVariants;
  232. }
  233. public IndexedIssueDto setCodeVariants(String codeVariants) {
  234. this.codeVariants = codeVariants;
  235. return this;
  236. }
  237. public Set<ImpactDto> getImpacts() {
  238. return impacts;
  239. }
  240. public Set<ImpactDto> getRuleDefaultImpacts() {
  241. return ruleDefaultImpacts;
  242. }
  243. public Map<SoftwareQuality, Severity> getEffectiveImpacts() {
  244. EnumMap<SoftwareQuality, Severity> effectiveImpacts = new EnumMap<>(SoftwareQuality.class);
  245. ruleDefaultImpacts.forEach(impact -> effectiveImpacts.put(impact.getSoftwareQuality(), impact.getSeverity()));
  246. impacts.forEach(impact -> effectiveImpacts.put(impact.getSoftwareQuality(), impact.getSeverity()));
  247. return Collections.unmodifiableMap(effectiveImpacts);
  248. }
  249. public String getCleanCodeAttribute() {
  250. return cleanCodeAttribute;
  251. }
  252. public IndexedIssueDto setCleanCodeAttribute(String cleanCodeAttribute) {
  253. this.cleanCodeAttribute = cleanCodeAttribute;
  254. return this;
  255. }
  256. }