Skip to content

Commit 1bcb9c7

Browse files
committed
Generate equals and hashCode for Request
1 parent 4dad3d6 commit 1bcb9c7

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

  • extractor/src/main/java/org/schabi/newpipe/extractor/downloader

extractor/src/main/java/org/schabi/newpipe/extractor/downloader/Request.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,4 +241,27 @@ public static Map<String, List<String>> headersFromLocalization(@Nullable Locali
241241

242242
return headers;
243243
}
244+
245+
/*//////////////////////////////////////////////////////////////////////////
246+
// Generated
247+
//////////////////////////////////////////////////////////////////////////*/
248+
249+
@Override
250+
public boolean equals(Object o) {
251+
if (this == o) return true;
252+
if (o == null || getClass() != o.getClass()) return false;
253+
Request request = (Request) o;
254+
return httpMethod.equals(request.httpMethod) &&
255+
url.equals(request.url) &&
256+
headers.equals(request.headers) &&
257+
Arrays.equals(dataToSend, request.dataToSend) &&
258+
Objects.equals(localization, request.localization);
259+
}
260+
261+
@Override
262+
public int hashCode() {
263+
int result = Objects.hash(httpMethod, url, headers, localization);
264+
result = 31 * result + Arrays.hashCode(dataToSend);
265+
return result;
266+
}
244267
}

0 commit comments

Comments
 (0)