From 301b9fa0244c78e4d8b1ef130ad58b7cd02bb02e Mon Sep 17 00:00:00 2001 From: TiA4f8R <74829229+TiA4f8R@users.noreply.github.com> Date: Sat, 7 May 2022 20:19:08 +0200 Subject: [PATCH] Remove hashCode and equals methods overrides of Stream classes --- .../newpipe/extractor/stream/AudioStream.java | 24 ----------------- .../newpipe/extractor/stream/Stream.java | 24 ----------------- .../extractor/stream/SubtitlesStream.java | 26 ------------------- .../newpipe/extractor/stream/VideoStream.java | 24 ----------------- 4 files changed, 98 deletions(-) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/AudioStream.java b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/AudioStream.java index 44d6e15ff..59cf9a323 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/AudioStream.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/AudioStream.java @@ -25,7 +25,6 @@ import org.schabi.newpipe.extractor.services.youtube.ItagItem; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import java.util.Objects; public final class AudioStream extends Stream { public static final int UNKNOWN_BITRATE = -1; @@ -381,27 +380,4 @@ public final class AudioStream extends Stream { public ItagItem getItagItem() { return itagItem; } - - @Override - public boolean equals(final Object obj) { - if (this == obj) { - return true; - } - - if (obj == null || getClass() != obj.getClass()) { - return false; - } - - if (!super.equals(obj)) { - return false; - } - - final AudioStream audioStream = (AudioStream) obj; - return averageBitrate == audioStream.averageBitrate; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), averageBitrate); - } } diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/Stream.java b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/Stream.java index 44ce2772e..e9232c8cf 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/Stream.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/Stream.java @@ -7,7 +7,6 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.io.Serializable; import java.util.List; -import java.util.Objects; import static org.schabi.newpipe.extractor.utils.Utils.isNullOrEmpty; @@ -214,27 +213,4 @@ public abstract class Stream implements Serializable { */ @Nullable public abstract ItagItem getItagItem(); - - @Override - public boolean equals(final Object obj) { - if (this == obj) { - return true; - } - - if (obj == null || getClass() != obj.getClass()) { - return false; - } - - final Stream stream = (Stream) obj; - return id.equals(stream.id) && mediaFormat == stream.mediaFormat - && deliveryMethod == stream.deliveryMethod - && content.equals(stream.content) - && isUrl == stream.isUrl - && Objects.equals(manifestUrl, stream.manifestUrl); - } - - @Override - public int hashCode() { - return Objects.hash(id, mediaFormat, deliveryMethod, content, isUrl, manifestUrl); - } } diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/SubtitlesStream.java b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/SubtitlesStream.java index b40d0e928..796264d41 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/SubtitlesStream.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/SubtitlesStream.java @@ -7,7 +7,6 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.util.Locale; -import java.util.Objects; import static org.schabi.newpipe.extractor.utils.Utils.EMPTY_STRING; @@ -328,29 +327,4 @@ public final class SubtitlesStream extends Stream { public ItagItem getItagItem() { return null; } - - @Override - public boolean equals(final Object obj) { - if (this == obj) { - return true; - } - - if (obj == null || getClass() != obj.getClass()) { - return false; - } - - if (!super.equals(obj)) { - return false; - } - - final SubtitlesStream subtitlesStream = (SubtitlesStream) obj; - return autoGenerated == subtitlesStream.autoGenerated - && locale.equals(subtitlesStream.locale) - && code.equals(subtitlesStream.code); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), locale, autoGenerated, code); - } } diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/VideoStream.java b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/VideoStream.java index 0709af90e..14952ebd1 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/VideoStream.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/VideoStream.java @@ -25,7 +25,6 @@ import org.schabi.newpipe.extractor.services.youtube.ItagItem; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import java.util.Objects; public final class VideoStream extends Stream { public static final String RESOLUTION_UNKNOWN = ""; @@ -483,27 +482,4 @@ public final class VideoStream extends Stream { public ItagItem getItagItem() { return itagItem; } - - @Override - public boolean equals(final Object obj) { - if (this == obj) { - return true; - } - - if (obj == null || getClass() != obj.getClass()) { - return false; - } - - if (!super.equals(obj)) { - return false; - } - - final VideoStream videoStream = (VideoStream) obj; - return isVideoOnly == videoStream.isVideoOnly && resolution.equals(videoStream.resolution); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), resolution, isVideoOnly); - } }