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.

ImpactDto.java 2.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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.io.Serializable;
  22. import java.util.Objects;
  23. import org.sonar.api.issue.impact.Severity;
  24. import org.sonar.api.issue.impact.SoftwareQuality;
  25. public class ImpactDto implements Serializable {
  26. private String uuid;
  27. private SoftwareQuality softwareQuality;
  28. private Severity severity;
  29. public ImpactDto() {
  30. // nothing to do
  31. }
  32. public ImpactDto(String uuid, SoftwareQuality softwareQuality, Severity severity) {
  33. this.uuid = uuid;
  34. this.softwareQuality = softwareQuality;
  35. this.severity = severity;
  36. }
  37. public String getUuid() {
  38. return uuid;
  39. }
  40. public ImpactDto setUuid(String uuid) {
  41. this.uuid = uuid;
  42. return this;
  43. }
  44. public SoftwareQuality getSoftwareQuality() {
  45. return softwareQuality;
  46. }
  47. public ImpactDto setSoftwareQuality(SoftwareQuality softwareQuality) {
  48. this.softwareQuality = softwareQuality;
  49. return this;
  50. }
  51. public Severity getSeverity() {
  52. return severity;
  53. }
  54. public ImpactDto setSeverity(Severity severity) {
  55. this.severity = severity;
  56. return this;
  57. }
  58. @Override
  59. public boolean equals(Object o) {
  60. if (this == o) {
  61. return true;
  62. }
  63. if (o == null || getClass() != o.getClass()) {
  64. return false;
  65. }
  66. ImpactDto impactDto = (ImpactDto) o;
  67. return Objects.equals(uuid, impactDto.uuid)
  68. && Objects.equals(softwareQuality, impactDto.softwareQuality)
  69. && Objects.equals(severity, impactDto.severity);
  70. }
  71. @Override
  72. public int hashCode() {
  73. return Objects.hash(uuid, softwareQuality, severity);
  74. }
  75. }