You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SearchRequest.java 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461
  1. /*
  2. * SonarQube
  3. * Copyright (C) 2009-2021 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> actionPlans;
  29. private List<String> additionalFields;
  30. private Boolean asc;
  31. private Boolean assigned;
  32. private List<String> assigneesUuid;
  33. private List<String> authors;
  34. private List<String> componentUuids;
  35. private List<String> components;
  36. private String createdAfter;
  37. private String createdAt;
  38. private String createdBefore;
  39. private String createdInLast;
  40. private List<String> directories;
  41. private String facetMode;
  42. private List<String> facets;
  43. private List<String> files;
  44. private List<String> issues;
  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> projects;
  53. private List<String> resolutions;
  54. private Boolean resolved;
  55. private List<String> rules;
  56. private Boolean sinceLeakPeriod;
  57. private String sort;
  58. private List<String> severities;
  59. private List<String> statuses;
  60. private List<String> tags;
  61. private Set<String> types;
  62. private List<String> owaspTop10;
  63. private List<String> sansTop25;
  64. private List<String> sonarsourceSecurity;
  65. private List<String> cwe;
  66. private String timeZone;
  67. public SearchRequest() {
  68. // nothing to do here
  69. }
  70. @CheckForNull
  71. public List<String> getActionPlans() {
  72. return actionPlans;
  73. }
  74. public SearchRequest setActionPlans(@Nullable List<String> actionPlans) {
  75. this.actionPlans = actionPlans;
  76. return this;
  77. }
  78. @CheckForNull
  79. public List<String> getAdditionalFields() {
  80. return additionalFields;
  81. }
  82. public SearchRequest setAdditionalFields(@Nullable List<String> additionalFields) {
  83. this.additionalFields = additionalFields;
  84. return this;
  85. }
  86. @CheckForNull
  87. public Boolean getAsc() {
  88. return asc;
  89. }
  90. public SearchRequest setAsc(boolean asc) {
  91. this.asc = asc;
  92. return this;
  93. }
  94. @CheckForNull
  95. public Boolean getAssigned() {
  96. return assigned;
  97. }
  98. public SearchRequest setAssigned(@Nullable Boolean assigned) {
  99. this.assigned = assigned;
  100. return this;
  101. }
  102. @CheckForNull
  103. public List<String> getAssigneeUuids() {
  104. return assigneesUuid;
  105. }
  106. public SearchRequest setAssigneesUuid(@Nullable List<String> assigneesUuid) {
  107. this.assigneesUuid = assigneesUuid;
  108. return this;
  109. }
  110. @CheckForNull
  111. public List<String> getAuthors() {
  112. return authors;
  113. }
  114. public SearchRequest setAuthors(@Nullable List<String> authors) {
  115. this.authors = authors;
  116. return this;
  117. }
  118. @CheckForNull
  119. public List<String> getComponentUuids() {
  120. return componentUuids;
  121. }
  122. public SearchRequest setComponentUuids(@Nullable List<String> componentUuids) {
  123. this.componentUuids = componentUuids;
  124. return this;
  125. }
  126. @CheckForNull
  127. public String getCreatedAfter() {
  128. return createdAfter;
  129. }
  130. public SearchRequest setCreatedAfter(@Nullable String createdAfter) {
  131. this.createdAfter = createdAfter;
  132. return this;
  133. }
  134. @CheckForNull
  135. public String getCreatedAt() {
  136. return createdAt;
  137. }
  138. public SearchRequest setCreatedAt(@Nullable String createdAt) {
  139. this.createdAt = createdAt;
  140. return this;
  141. }
  142. @CheckForNull
  143. public String getCreatedBefore() {
  144. return createdBefore;
  145. }
  146. public SearchRequest setCreatedBefore(@Nullable String createdBefore) {
  147. this.createdBefore = createdBefore;
  148. return this;
  149. }
  150. @CheckForNull
  151. public String getCreatedInLast() {
  152. return createdInLast;
  153. }
  154. public SearchRequest setCreatedInLast(@Nullable String createdInLast) {
  155. this.createdInLast = createdInLast;
  156. return this;
  157. }
  158. @CheckForNull
  159. public List<String> getDirectories() {
  160. return directories;
  161. }
  162. public SearchRequest setDirectories(@Nullable List<String> directories) {
  163. this.directories = directories;
  164. return this;
  165. }
  166. @CheckForNull
  167. public String getFacetMode() {
  168. return facetMode;
  169. }
  170. public SearchRequest setFacetMode(@Nullable String facetMode) {
  171. this.facetMode = facetMode;
  172. return this;
  173. }
  174. @CheckForNull
  175. public List<String> getFacets() {
  176. return facets;
  177. }
  178. public SearchRequest setFacets(@Nullable List<String> facets) {
  179. this.facets = facets;
  180. return this;
  181. }
  182. @CheckForNull
  183. public List<String> getFiles() {
  184. return files;
  185. }
  186. public SearchRequest setFiles(@Nullable List<String> files) {
  187. this.files = files;
  188. return this;
  189. }
  190. @CheckForNull
  191. public List<String> getIssues() {
  192. return issues;
  193. }
  194. public SearchRequest setIssues(@Nullable List<String> issues) {
  195. this.issues = issues;
  196. return this;
  197. }
  198. @CheckForNull
  199. public Set<String> getScopes() {
  200. return scopes;
  201. }
  202. public SearchRequest setScopes(@Nullable Collection<String> scopes) {
  203. this.scopes = scopes == null ? null : ImmutableSet.copyOf(scopes);
  204. return this;
  205. }
  206. @CheckForNull
  207. public List<String> getLanguages() {
  208. return languages;
  209. }
  210. public SearchRequest setLanguages(@Nullable List<String> languages) {
  211. this.languages = languages;
  212. return this;
  213. }
  214. @CheckForNull
  215. public Boolean getOnComponentOnly() {
  216. return onComponentOnly;
  217. }
  218. public SearchRequest setOnComponentOnly(@Nullable Boolean onComponentOnly) {
  219. this.onComponentOnly = onComponentOnly;
  220. return this;
  221. }
  222. public int getPage() {
  223. return page;
  224. }
  225. public SearchRequest setPage(int page) {
  226. this.page = page;
  227. return this;
  228. }
  229. public int getPageSize() {
  230. return pageSize;
  231. }
  232. public SearchRequest setPageSize(int pageSize) {
  233. this.pageSize = pageSize;
  234. return this;
  235. }
  236. @CheckForNull
  237. public List<String> getResolutions() {
  238. return resolutions;
  239. }
  240. public SearchRequest setResolutions(@Nullable List<String> resolutions) {
  241. this.resolutions = resolutions;
  242. return this;
  243. }
  244. @CheckForNull
  245. public Boolean getResolved() {
  246. return resolved;
  247. }
  248. public SearchRequest setResolved(@Nullable Boolean resolved) {
  249. this.resolved = resolved;
  250. return this;
  251. }
  252. @CheckForNull
  253. public List<String> getRules() {
  254. return rules;
  255. }
  256. public SearchRequest setRules(@Nullable List<String> rules) {
  257. this.rules = rules;
  258. return this;
  259. }
  260. @CheckForNull
  261. public Boolean getSinceLeakPeriod() {
  262. return sinceLeakPeriod;
  263. }
  264. public SearchRequest setSinceLeakPeriod(@Nullable Boolean sinceLeakPeriod) {
  265. this.sinceLeakPeriod = sinceLeakPeriod;
  266. return this;
  267. }
  268. @CheckForNull
  269. public String getSort() {
  270. return sort;
  271. }
  272. public SearchRequest setSort(@Nullable String sort) {
  273. this.sort = sort;
  274. return this;
  275. }
  276. @CheckForNull
  277. public List<String> getSeverities() {
  278. return severities;
  279. }
  280. public SearchRequest setSeverities(@Nullable List<String> severities) {
  281. this.severities = severities;
  282. return this;
  283. }
  284. @CheckForNull
  285. public List<String> getStatuses() {
  286. return statuses;
  287. }
  288. public SearchRequest setStatuses(@Nullable List<String> statuses) {
  289. this.statuses = statuses;
  290. return this;
  291. }
  292. @CheckForNull
  293. public List<String> getTags() {
  294. return tags;
  295. }
  296. public SearchRequest setTags(@Nullable List<String> tags) {
  297. this.tags = tags;
  298. return this;
  299. }
  300. @CheckForNull
  301. public Set<String> getTypes() {
  302. return types;
  303. }
  304. public SearchRequest setTypes(@Nullable Collection<String> types) {
  305. this.types = types == null ? null : ImmutableSet.copyOf(types);
  306. return this;
  307. }
  308. @CheckForNull
  309. public List<String> getOwaspTop10() {
  310. return owaspTop10;
  311. }
  312. public SearchRequest setOwaspTop10(@Nullable List<String> owaspTop10) {
  313. this.owaspTop10 = owaspTop10;
  314. return this;
  315. }
  316. @CheckForNull
  317. public List<String> getSansTop25() {
  318. return sansTop25;
  319. }
  320. public SearchRequest setSansTop25(@Nullable List<String> sansTop25) {
  321. this.sansTop25 = sansTop25;
  322. return this;
  323. }
  324. @CheckForNull
  325. public List<String> getCwe() {
  326. return cwe;
  327. }
  328. public SearchRequest setCwe(@Nullable List<String> cwe) {
  329. this.cwe = cwe;
  330. return this;
  331. }
  332. @CheckForNull
  333. public List<String> getSonarsourceSecurity() {
  334. return sonarsourceSecurity;
  335. }
  336. public SearchRequest setSonarsourceSecurity(@Nullable List<String> sonarsourceSecurity) {
  337. this.sonarsourceSecurity = sonarsourceSecurity;
  338. return this;
  339. }
  340. @CheckForNull
  341. public List<String> getComponents() {
  342. return components;
  343. }
  344. public SearchRequest setComponents(@Nullable List<String> components) {
  345. this.components = components;
  346. return this;
  347. }
  348. @CheckForNull
  349. public List<String> getProjects() {
  350. return projects;
  351. }
  352. public SearchRequest setProjects(@Nullable List<String> projects) {
  353. this.projects = projects;
  354. return this;
  355. }
  356. @CheckForNull
  357. public String getBranch() {
  358. return branch;
  359. }
  360. public SearchRequest setBranch(@Nullable String branch) {
  361. this.branch = branch;
  362. return this;
  363. }
  364. @CheckForNull
  365. public String getPullRequest() {
  366. return pullRequest;
  367. }
  368. public SearchRequest setPullRequest(@Nullable String pullRequest) {
  369. this.pullRequest = pullRequest;
  370. return this;
  371. }
  372. @CheckForNull
  373. public String getTimeZone() {
  374. return timeZone;
  375. }
  376. public SearchRequest setTimeZone(@Nullable String timeZone) {
  377. this.timeZone = timeZone;
  378. return this;
  379. }
  380. }