From a6e64c70f7c82d87d552ead1f832cb780a70948b Mon Sep 17 00:00:00 2001 From: HotDog Date: Mon, 15 Dec 2025 15:37:00 -0800 Subject: [PATCH] Override equals method in CustomSignals class When I wrote code using the CustomSignals class, in the tests, I tried to verify if my code calling the setCustomSignals(CustomSignals) method really passed the correct parameter. But since the CustomSignals class doesn't currently have any method that allows external packages to get its content, nor does it even have the equals method implemented, I cannot check if 2 CustomSignals objects have the same contents. This commit overrides the equals method to enable testing involving the CustomSignals class. --- .../google/firebase/remoteconfig/CustomSignals.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/firebase-config/src/main/java/com/google/firebase/remoteconfig/CustomSignals.java b/firebase-config/src/main/java/com/google/firebase/remoteconfig/CustomSignals.java index 78d8d6cc415..21d44888588 100644 --- a/firebase-config/src/main/java/com/google/firebase/remoteconfig/CustomSignals.java +++ b/firebase-config/src/main/java/com/google/firebase/remoteconfig/CustomSignals.java @@ -83,4 +83,16 @@ public CustomSignals build() { CustomSignals(@NonNull Builder builder) { this.customSignals = builder.customSignals; } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null || ! obj instanceof CustomSignals) { + return false; + } + CustomSignals otherCustomSignal = (CustomSignals) obj; + return this.customSignals.equals(obj.customSignals); + } }