X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=dashboard%2Fwebapp-backend%2Fsrc%2Fmain%2Fjava%2Forg%2Foransc%2Fric%2Fportal%2Fdashboard%2Fmodel%2FAppStats.java;h=8a12bf82a033d4587b9321b1959976fa21c8fbfb;hb=848677173191182d46aa22ab83bee0de84999a81;hp=6710cf6e7e0e5a9ac9c9fed2bb364b10ac86e04f;hpb=eb7e7f53f6cc186fd4319c729f3138540aac741a;p=portal%2Fric-dashboard.git diff --git a/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/AppStats.java b/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/AppStats.java index 6710cf6e..8a12bf82 100644 --- a/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/AppStats.java +++ b/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/AppStats.java @@ -19,6 +19,8 @@ */ package org.oransc.ric.portal.dashboard.model; +import java.util.Objects; + public class AppStats implements IDashboardResponse { private String instanceKey; private StatsDetailsTransport statsDetails; @@ -54,4 +56,25 @@ public class AppStats implements IDashboardResponse { return this.getClass().getSimpleName() + "[instance=" + instanceKey + ", statsDetails=" + statsDetails + "]"; } + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + AppStats other = (AppStats) obj; + return Objects.equals(instanceKey, other.instanceKey) && Objects.equals(statsDetails, other.statsDetails); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + ((instanceKey == null) ? 0 : instanceKey.hashCode()); + result = prime * result + ((statsDetails == null) ? 0 : statsDetails.hashCode()); + return result; + } + }