選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

SearchRequest.java 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556
  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.server.issue;
  21. import com.google.common.collect.ImmutableSet;
  22. import java.util.Collection;
  23. import java.util.List;
  24. import java.util.Set;
  25. import javax.annotation.CheckForNull;
  26. import javax.annotation.Nullable;
  27. public class SearchRequest {
  28. private List<String> additionalFields;
  29. private Boolean asc;
  30. private Boolean assigned;
  31. private List<String> assigneesUuid;
  32. private List<String> authors;
  33. private List<String> componentUuids;
  34. private List<String> componentKeys;
  35. private String createdAfter;
  36. private String createdAt;
  37. private String createdBefore;
  38. private String createdInLast;
  39. private List<String> directories;
  40. private String facetMode;
  41. private List<String> facets;
  42. private List<String> files;
  43. private List<String> issues;
  44. private Boolean inNewCodePeriod;
  45. private Set<String> scopes;
  46. private List<String> languages;
  47. private Boolean onComponentOnly;
  48. private String branch;
  49. private String pullRequest;
  50. private int page;
  51. private int pageSize;
  52. private List<String> projectKeys;
  53. private List<String> resolutions;
  54. private Boolean resolved;
  55. private List<String> rules;
  56. private String sort;
  57. private List<String> severities;
  58. private List<String> impactSeverities;
  59. private List<String> impactSoftwareQualities;
  60. private List<String> cleanCodeAttributesCategories;
  61. private List<String> statuses;
  62. private List<String> issueStatuses;
  63. private List<String> tags;
  64. private Set<String> types;
  65. private List<String> pciDss32;
  66. private List<String> pciDss40;
  67. private List<String> owaspTop10;
  68. private List<String> owaspAsvs40;
  69. private List<String> owaspTop10For2021;
  70. private List<String> sansTop25;
  71. private List<String> sonarsourceSecurity;
  72. private List<String> cwe;
  73. private String timeZone;
  74. private Integer owaspAsvsLevel;
  75. private List<String> codeVariants;
  76. public SearchRequest() {
  77. // nothing to do here
  78. }
  79. @CheckForNull
  80. public List<String> getAdditionalFields() {
  81. return additionalFields;
  82. }
  83. public SearchRequest setAdditionalFields(@Nullable List<String> additionalFields) {
  84. this.additionalFields = additionalFields;
  85. return this;
  86. }
  87. @CheckForNull
  88. public Boolean getAsc() {
  89. return asc;
  90. }
  91. public SearchRequest setAsc(boolean asc) {
  92. this.asc = asc;
  93. return this;
  94. }
  95. @CheckForNull
  96. public Boolean getAssigned() {
  97. return assigned;
  98. }
  99. public SearchRequest setAssigned(@Nullable Boolean assigned) {
  100. this.assigned = assigned;
  101. return this;
  102. }
  103. @CheckForNull
  104. public List<String> getAssigneeUuids() {
  105. return assigneesUuid;
  106. }
  107. public SearchRequest setAssigneesUuid(@Nullable List<String> assigneesUuid) {
  108. this.assigneesUuid = assigneesUuid;
  109. return this;
  110. }
  111. @CheckForNull
  112. public List<String> getAuthors() {
  113. return authors;
  114. }
  115. public SearchRequest setAuthors(@Nullable List<String> authors) {
  116. this.authors = authors;
  117. return this;
  118. }
  119. @CheckForNull
  120. public List<String> getComponentUuids() {
  121. return componentUuids;
  122. }
  123. public SearchRequest setComponentUuids(@Nullable List<String> componentUuids) {
  124. this.componentUuids = componentUuids;
  125. return this;
  126. }
  127. @CheckForNull
  128. public String getCreatedAfter() {
  129. return createdAfter;
  130. }
  131. public SearchRequest setCreatedAfter(@Nullable String createdAfter) {
  132. this.createdAfter = createdAfter;
  133. return this;
  134. }
  135. @CheckForNull
  136. public String getCreatedAt() {
  137. return createdAt;
  138. }
  139. public SearchRequest setCreatedAt(@Nullable String createdAt) {
  140. this.createdAt = createdAt;
  141. return this;
  142. }
  143. @CheckForNull
  144. public String getCreatedBefore() {
  145. return createdBefore;
  146. }
  147. public SearchRequest setCreatedBefore(@Nullable String createdBefore) {
  148. this.createdBefore = createdBefore;
  149. return this;
  150. }
  151. @CheckForNull
  152. public String getCreatedInLast() {
  153. return createdInLast;
  154. }
  155. public SearchRequest setCreatedInLast(@Nullable String createdInLast) {
  156. this.createdInLast = createdInLast;
  157. return this;
  158. }
  159. @CheckForNull
  160. public List<String> getDirectories() {
  161. return directories;
  162. }
  163. public SearchRequest setDirectories(@Nullable List<String> directories) {
  164. this.directories = directories;
  165. return this;
  166. }
  167. @CheckForNull
  168. public String getFacetMode() {
  169. return facetMode;
  170. }
  171. public SearchRequest setFacetMode(@Nullable String facetMode) {
  172. this.facetMode = facetMode;
  173. return this;
  174. }
  175. @CheckForNull
  176. public List<String> getFacets() {
  177. return facets;
  178. }
  179. public SearchRequest setFacets(@Nullable List<String> facets) {
  180. this.facets = facets;
  181. return this;
  182. }
  183. @CheckForNull
  184. public List<String> getFiles() {
  185. return files;
  186. }
  187. public SearchRequest setFiles(@Nullable List<String> files) {
  188. this.files = files;
  189. return this;
  190. }
  191. @CheckForNull
  192. public List<String> getIssues() {
  193. return issues;
  194. }
  195. public SearchRequest setIssues(@Nullable List<String> issues) {
  196. this.issues = issues;
  197. return this;
  198. }
  199. @CheckForNull
  200. public Set<String> getScopes() {
  201. return scopes;
  202. }
  203. public SearchRequest setScopes(@Nullable Collection<String> scopes) {
  204. this.scopes = scopes == null ? null : ImmutableSet.copyOf(scopes);
  205. return this;
  206. }
  207. @CheckForNull
  208. public List<String> getLanguages() {
  209. return languages;
  210. }
  211. public SearchRequest setLanguages(@Nullable List<String> languages) {
  212. this.languages = languages;
  213. return this;
  214. }
  215. @CheckForNull
  216. public Boolean getOnComponentOnly() {
  217. return onComponentOnly;
  218. }
  219. public SearchRequest setOnComponentOnly(@Nullable Boolean onComponentOnly) {
  220. this.onComponentOnly = onComponentOnly;
  221. return this;
  222. }
  223. public int getPage() {
  224. return page;
  225. }
  226. public SearchRequest setPage(int page) {
  227. this.page = page;
  228. return this;
  229. }
  230. public int getPageSize() {
  231. return pageSize;
  232. }
  233. public SearchRequest setPageSize(int pageSize) {
  234. this.pageSize = pageSize;
  235. return this;
  236. }
  237. @CheckForNull
  238. public List<String> getResolutions() {
  239. return resolutions;
  240. }
  241. public SearchRequest setResolutions(@Nullable List<String> resolutions) {
  242. this.resolutions = resolutions;
  243. return this;
  244. }
  245. @CheckForNull
  246. public Boolean getResolved() {
  247. return resolved;
  248. }
  249. public SearchRequest setResolved(@Nullable Boolean resolved) {
  250. this.resolved = resolved;
  251. return this;
  252. }
  253. @CheckForNull
  254. public List<String> getRules() {
  255. return rules;
  256. }
  257. public SearchRequest setRules(@Nullable List<String> rules) {
  258. this.rules = rules;
  259. return this;
  260. }
  261. @CheckForNull
  262. public String getSort() {
  263. return sort;
  264. }
  265. public SearchRequest setSort(@Nullable String sort) {
  266. this.sort = sort;
  267. return this;
  268. }
  269. @CheckForNull
  270. public List<String> getSeverities() {
  271. return severities;
  272. }
  273. public SearchRequest setSeverities(@Nullable List<String> severities) {
  274. this.severities = severities;
  275. return this;
  276. }
  277. @CheckForNull
  278. public List<String> getStatuses() {
  279. return statuses;
  280. }
  281. public SearchRequest setStatuses(@Nullable List<String> statuses) {
  282. this.statuses = statuses;
  283. return this;
  284. }
  285. public SearchRequest setIssueStatuses(@Nullable List<String> issueStatuses) {
  286. this.issueStatuses = issueStatuses;
  287. return this;
  288. }
  289. @CheckForNull
  290. public List<String> getIssueStatuses() {
  291. return issueStatuses;
  292. }
  293. @CheckForNull
  294. public List<String> getTags() {
  295. return tags;
  296. }
  297. public SearchRequest setTags(@Nullable List<String> tags) {
  298. this.tags = tags;
  299. return this;
  300. }
  301. @CheckForNull
  302. public Set<String> getTypes() {
  303. return types;
  304. }
  305. public SearchRequest setTypes(@Nullable Collection<String> types) {
  306. this.types = types == null ? null : ImmutableSet.copyOf(types);
  307. return this;
  308. }
  309. @CheckForNull
  310. public List<String> getPciDss32() {
  311. return pciDss32;
  312. }
  313. public SearchRequest setPciDss32(@Nullable List<String> pciDss32) {
  314. this.pciDss32 = pciDss32;
  315. return this;
  316. }
  317. @CheckForNull
  318. public List<String> getPciDss40() {
  319. return pciDss40;
  320. }
  321. public SearchRequest setPciDss40(@Nullable List<String> pciDss40) {
  322. this.pciDss40 = pciDss40;
  323. return this;
  324. }
  325. @CheckForNull
  326. public List<String> getOwaspAsvs40() {
  327. return owaspAsvs40;
  328. }
  329. public SearchRequest setOwaspAsvs40(@Nullable List<String> owaspAsvs40) {
  330. this.owaspAsvs40 = owaspAsvs40;
  331. return this;
  332. }
  333. @CheckForNull
  334. public List<String> getOwaspTop10() {
  335. return owaspTop10;
  336. }
  337. public SearchRequest setOwaspTop10(@Nullable List<String> owaspTop10) {
  338. this.owaspTop10 = owaspTop10;
  339. return this;
  340. }
  341. @CheckForNull
  342. public List<String> getOwaspTop10For2021() {
  343. return owaspTop10For2021;
  344. }
  345. public SearchRequest setOwaspTop10For2021(@Nullable List<String> owaspTop10For2021) {
  346. this.owaspTop10For2021 = owaspTop10For2021;
  347. return this;
  348. }
  349. @CheckForNull
  350. public List<String> getSansTop25() {
  351. return sansTop25;
  352. }
  353. public SearchRequest setSansTop25(@Nullable List<String> sansTop25) {
  354. this.sansTop25 = sansTop25;
  355. return this;
  356. }
  357. @CheckForNull
  358. public List<String> getCwe() {
  359. return cwe;
  360. }
  361. public SearchRequest setCwe(@Nullable List<String> cwe) {
  362. this.cwe = cwe;
  363. return this;
  364. }
  365. @CheckForNull
  366. public List<String> getSonarsourceSecurity() {
  367. return sonarsourceSecurity;
  368. }
  369. public SearchRequest setSonarsourceSecurity(@Nullable List<String> sonarsourceSecurity) {
  370. this.sonarsourceSecurity = sonarsourceSecurity;
  371. return this;
  372. }
  373. @CheckForNull
  374. public List<String> getComponentKeys() {
  375. return componentKeys;
  376. }
  377. public SearchRequest setComponentKeys(@Nullable List<String> componentKeys) {
  378. this.componentKeys = componentKeys;
  379. return this;
  380. }
  381. @CheckForNull
  382. public List<String> getProjectKeys() {
  383. return projectKeys;
  384. }
  385. public SearchRequest setProjectKeys(@Nullable List<String> projectKeys) {
  386. this.projectKeys = projectKeys;
  387. return this;
  388. }
  389. @CheckForNull
  390. public String getBranch() {
  391. return branch;
  392. }
  393. public SearchRequest setBranch(@Nullable String branch) {
  394. this.branch = branch;
  395. return this;
  396. }
  397. @CheckForNull
  398. public String getPullRequest() {
  399. return pullRequest;
  400. }
  401. public SearchRequest setPullRequest(@Nullable String pullRequest) {
  402. this.pullRequest = pullRequest;
  403. return this;
  404. }
  405. @CheckForNull
  406. public String getTimeZone() {
  407. return timeZone;
  408. }
  409. public SearchRequest setTimeZone(@Nullable String timeZone) {
  410. this.timeZone = timeZone;
  411. return this;
  412. }
  413. @CheckForNull
  414. public Boolean getInNewCodePeriod() {
  415. return inNewCodePeriod;
  416. }
  417. public SearchRequest setInNewCodePeriod(@Nullable Boolean inNewCodePeriod) {
  418. this.inNewCodePeriod = inNewCodePeriod;
  419. return this;
  420. }
  421. public Integer getOwaspAsvsLevel() {
  422. return owaspAsvsLevel;
  423. }
  424. public SearchRequest setOwaspAsvsLevel(@Nullable Integer owaspAsvsLevel) {
  425. this.owaspAsvsLevel = owaspAsvsLevel;
  426. return this;
  427. }
  428. @CheckForNull
  429. public List<String> getCodeVariants() {
  430. return codeVariants;
  431. }
  432. public SearchRequest setCodeVariants(@Nullable List<String> codeVariants) {
  433. this.codeVariants = codeVariants;
  434. return this;
  435. }
  436. public List<String> getImpactSeverities() {
  437. return impactSeverities;
  438. }
  439. public SearchRequest setImpactSeverities(@Nullable List<String> impactSeverities) {
  440. this.impactSeverities = impactSeverities;
  441. return this;
  442. }
  443. public List<String> getImpactSoftwareQualities() {
  444. return impactSoftwareQualities;
  445. }
  446. public SearchRequest setImpactSoftwareQualities(@Nullable List<String> impactSoftwareQualities) {
  447. this.impactSoftwareQualities = impactSoftwareQualities;
  448. return this;
  449. }
  450. public List<String> getCleanCodeAttributesCategories() {
  451. return cleanCodeAttributesCategories;
  452. }
  453. public SearchRequest setCleanCodeAttributesCategories(@Nullable List<String> cleanCodeAttributesCategories) {
  454. this.cleanCodeAttributesCategories = cleanCodeAttributesCategories;
  455. return this;
  456. }
  457. }