-
Notifications
You must be signed in to change notification settings - Fork 9
add link id regex field to services #475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
@@ -57,6 +72,7 @@ public String toString() { | |||
", siteId=" + siteId + | |||
", name='" + name + '\'' + | |||
", roles=" + roles + | |||
", linkIdRegex=" + linkIdRegex + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it fail when linkIdRegex
is null?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, java handles the concatenation by automatically converting null to "null"
return serviceId == service.serviceId && siteId == service.siteId && name.equals(service.name) && roles.equals(service.roles); | ||
boolean compare = serviceId == service.serviceId && siteId == service.siteId && name.equals(service.name) && roles.equals(service.roles); | ||
if (linkIdRegex == null || service.linkIdRegex == null) { | ||
return compare && linkIdRegex == service.linkIdRegex; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can use && Objects.equals(linkIdRegex, service.linkIdRegex)
to skip the null tests.
@@ -30,6 +37,14 @@ public int getSiteId() { | |||
return siteId; | |||
} | |||
|
|||
public String getLinkIdRegex() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Can we move the new methods so that getSiteId
and setSiteId
are next to each other?
No description provided.