From 6419e93f12f4210936e31524abf8b78832f7acb1 Mon Sep 17 00:00:00 2001 From: Henigan Date: Wed, 9 Dec 2020 17:04:35 -0500 Subject: add override methods for missed rpc responses --- .../proxy/rpc/DeleteWindowResponse.java | 23 ++++++++++++++++++++++ .../proxy/rpc/SetAppIconResponse.java | 23 ++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteWindowResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteWindowResponse.java index 4c1551300..c50418cf9 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteWindowResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteWindowResponse.java @@ -1,6 +1,7 @@ package com.smartdevicelink.proxy.rpc; import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCResponse; @@ -44,4 +45,26 @@ public class DeleteWindowResponse extends RPCResponse { setSuccess(success); setResultCode(resultCode); } + + @Override + public int hashCode() { + return super.hashCode(); + } + + @Override + public boolean equals(@Nullable Object obj) { + if (obj == null) return false; + // if this is the same memory address, it's the same + if (this == obj) return true; + // if this is not an instance of DeleteWindowResponse, not the same + if (!(obj instanceof DeleteWindowResponse)) return false; + // return comparison + return hashCode() == obj.hashCode(); + } + + @NonNull + @Override + protected Object clone() throws CloneNotSupportedException { + return super.clone(); + } } \ No newline at end of file diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetAppIconResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetAppIconResponse.java index e0862d2c7..0749fb630 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetAppIconResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetAppIconResponse.java @@ -32,6 +32,7 @@ package com.smartdevicelink.proxy.rpc; import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCResponse; @@ -76,4 +77,26 @@ public class SetAppIconResponse extends RPCResponse { setSuccess(success); setResultCode(resultCode); } + + @Override + public int hashCode() { + return super.hashCode(); + } + + @Override + public boolean equals(@Nullable Object obj) { + if (obj == null) return false; + // if this is the same memory address, it's the same + if (this == obj) return true; + // if this is not an instance of SetAppIconResponse, not the same + if (!(obj instanceof SetAppIconResponse)) return false; + // return comparison + return hashCode() == obj.hashCode(); + } + + @NonNull + @Override + protected Object clone() throws CloneNotSupportedException { + return super.clone(); + } } \ No newline at end of file -- cgit v1.2.1