From 44e9ba0be1ef6e01d15ea1a90772085e11d445ea Mon Sep 17 00:00:00 2001 From: idawda Date: Thu, 18 Jul 2024 16:16:33 +0530 Subject: [PATCH] Implement equals for ExternalConnection schema Co-authored-by: Lovesh Baya --- .../models/javaagent/ExternalConnection.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/newrelic-security-agent/src/main/java/com/newrelic/agent/security/intcodeagent/models/javaagent/ExternalConnection.java b/newrelic-security-agent/src/main/java/com/newrelic/agent/security/intcodeagent/models/javaagent/ExternalConnection.java index 7b4c5cca6..81df0a570 100644 --- a/newrelic-security-agent/src/main/java/com/newrelic/agent/security/intcodeagent/models/javaagent/ExternalConnection.java +++ b/newrelic-security-agent/src/main/java/com/newrelic/agent/security/intcodeagent/models/javaagent/ExternalConnection.java @@ -88,6 +88,15 @@ public boolean isEmpty() { return false; } + @Override + public boolean equals(Object obj) { + if (obj instanceof ExternalConnection) { + ExternalConnection connection = (ExternalConnection) obj; + return Objects.equals(host, connection.host) && Objects.equals(port, connection.port) && Objects.equals(connectionUrl, connection.connectionUrl) && Objects.equals(type, connection.type); + } + return false; + } + @Override public int hashCode() { return Objects.hash(host, port, connectionUrl, type);