Remove hashCode and equals methods overrides of Stream classes

This commit is contained in:
TiA4f8R 2022-05-07 20:19:08 +02:00
parent 2f3920c648
commit 301b9fa024
No known key found for this signature in database
GPG Key ID: E6D3E7F5949450DD
4 changed files with 0 additions and 98 deletions

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}