From 1bcb9c76a7c62628d66d2aa5a9fe97e199f5a7a5 Mon Sep 17 00:00:00 2001 From: XiangRongLin <41164160+XiangRongLin@users.noreply.github.com> Date: Tue, 15 Dec 2020 15:10:21 +0100 Subject: [PATCH] Generate equals and hashCode for Request --- .../newpipe/extractor/downloader/Request.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/downloader/Request.java b/extractor/src/main/java/org/schabi/newpipe/extractor/downloader/Request.java index 630bb59e..271f151c 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/downloader/Request.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/downloader/Request.java @@ -241,4 +241,27 @@ public class Request { return headers; } + + /*////////////////////////////////////////////////////////////////////////// + // Generated + //////////////////////////////////////////////////////////////////////////*/ + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Request request = (Request) o; + return httpMethod.equals(request.httpMethod) && + url.equals(request.url) && + headers.equals(request.headers) && + Arrays.equals(dataToSend, request.dataToSend) && + Objects.equals(localization, request.localization); + } + + @Override + public int hashCode() { + int result = Objects.hash(httpMethod, url, headers, localization); + result = 31 * result + Arrays.hashCode(dataToSend); + return result; + } }