Skip to content

Commit c6db05a

Browse files
committed
small fixes and refactor
1 parent aa0ae88 commit c6db05a

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/main/java/com/uid2/shared/model/Service.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ public int getSiteId() {
3737
return siteId;
3838
}
3939

40+
public void setSiteId(int siteId) {
41+
this.siteId = siteId;
42+
}
43+
4044
public String getLinkIdRegex() {
4145
return linkIdRegex;
4246
}
@@ -45,10 +49,6 @@ public void setLinkIdRegex(String linkIdRegex) {
4549
this.linkIdRegex = linkIdRegex;
4650
}
4751

48-
public void setSiteId(int siteId) {
49-
this.siteId = siteId;
50-
}
51-
5252
public String getName() {
5353
return name;
5454
}
@@ -79,14 +79,14 @@ public String toString() {
7979
@Override
8080
public boolean equals(Object o) {
8181
if (this == o) return true;
82-
if (o == null || getClass() != o.getClass()) return false;
83-
Service service = (Service) o;
84-
boolean compare = serviceId == service.serviceId && siteId == service.siteId && name.equals(service.name) && roles.equals(service.roles);
85-
if (linkIdRegex == null || service.linkIdRegex == null) {
86-
return compare && linkIdRegex == service.linkIdRegex;
87-
}
88-
89-
return compare && linkIdRegex.equals(service.linkIdRegex);
82+
if (!(o instanceof Service)) return false;
83+
Service other = (Service) o;
84+
85+
return serviceId == other.serviceId
86+
&& siteId == other.siteId
87+
&& Objects.equals(name, other.name)
88+
&& Objects.equals(roles, other.roles)
89+
&& Objects.equals(linkIdRegex, other.linkIdRegex);
9090
}
9191

9292
@Override

0 commit comments

Comments
 (0)