aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-db-dao
diff options
context:
space:
mode:
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>2018-01-17 11:38:41 +0100
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>2018-01-23 09:36:10 +0100
commit02f395de404b0959a778afc136d0b06e3ac93633 (patch)
tree3ce396e0178219c6feba9ccf0e638f063ed3bcd8 /server/sonar-db-dao
parent0ef6fee997436227e1d092473ba11613d089a669 (diff)
downloadsonarqube-02f395de404b0959a778afc136d0b06e3ac93633.tar.gz
sonarqube-02f395de404b0959a778afc136d0b06e3ac93633.zip
SONAR-10247 add OrganizationDto#equals & hashcode
usefull in unit tests
Diffstat (limited to 'server/sonar-db-dao')
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/organization/OrganizationDto.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/organization/OrganizationDto.java b/server/sonar-db-dao/src/main/java/org/sonar/db/organization/OrganizationDto.java
index e0c3c09f0ab..e8548462f38 100644
--- a/server/sonar-db-dao/src/main/java/org/sonar/db/organization/OrganizationDto.java
+++ b/server/sonar-db-dao/src/main/java/org/sonar/db/organization/OrganizationDto.java
@@ -19,6 +19,7 @@
*/
package org.sonar.db.organization;
+import java.util.Objects;
import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
@@ -158,6 +159,23 @@ public class OrganizationDto {
}
@Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ OrganizationDto that = (OrganizationDto) o;
+ return Objects.equals(uuid, that.uuid);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(uuid);
+ }
+
+ @Override
public String toString() {
return "OrganizationDto{" +
"uuid='" + uuid + '\'' +