Skip to content

Commit

Permalink
Implement equals & hashCode methods for NotificationTemplate
Browse files Browse the repository at this point in the history
  • Loading branch information
darshanasbg committed Apr 17, 2024
1 parent ba607bc commit b618230
Showing 1 changed file with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*/
package org.wso2.carbon.identity.governance.model;

import java.util.Objects;

/**
* Object which encapsulates notification template properties.
*/
Expand Down Expand Up @@ -188,4 +190,36 @@ public void setBody(String body) {

this.body = body;
}

@Override
public boolean equals(java.lang.Object o) {

if (this == o) {
return true;
}

if (o == null || getClass() != o.getClass()) {
return false;
}

if (!super.equals(o)) {
return false;
}

NotificationTemplate notificationTemplate = (NotificationTemplate) o;
return Objects.equals(this.type, notificationTemplate.type) &&
Objects.equals(this.displayName, notificationTemplate.displayName) &&
Objects.equals(this.locale, notificationTemplate.locale) &&
Objects.equals(this.body, notificationTemplate.body) &&
Objects.equals(this.contentType, notificationTemplate.contentType) &&
Objects.equals(this.notificationChannel, notificationTemplate.notificationChannel) &&
Objects.equals(this.subject, notificationTemplate.subject) &&
Objects.equals(this.footer, notificationTemplate.footer);
}

@Override
public int hashCode() {

return Objects.hash(type, displayName, locale, body, contentType, notificationChannel, subject, footer);
}
}

0 comments on commit b618230

Please sign in to comment.