mirror of
https://github.com/TeamNewPipe/NewPipeExtractor.git
synced 2025-04-29 00:10:35 +05:30
Remove hashCode and equals methods overrides of Stream classes
This commit is contained in:
parent
2f3920c648
commit
301b9fa024
@ -25,7 +25,6 @@ import org.schabi.newpipe.extractor.services.youtube.ItagItem;
|
|||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
public final class AudioStream extends Stream {
|
public final class AudioStream extends Stream {
|
||||||
public static final int UNKNOWN_BITRATE = -1;
|
public static final int UNKNOWN_BITRATE = -1;
|
||||||
@ -381,27 +380,4 @@ public final class AudioStream extends Stream {
|
|||||||
public ItagItem getItagItem() {
|
public ItagItem getItagItem() {
|
||||||
return itagItem;
|
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,6 @@ import javax.annotation.Nonnull;
|
|||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
import static org.schabi.newpipe.extractor.utils.Utils.isNullOrEmpty;
|
import static org.schabi.newpipe.extractor.utils.Utils.isNullOrEmpty;
|
||||||
|
|
||||||
@ -214,27 +213,4 @@ public abstract class Stream implements Serializable {
|
|||||||
*/
|
*/
|
||||||
@Nullable
|
@Nullable
|
||||||
public abstract ItagItem getItagItem();
|
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,6 @@ import javax.annotation.Nonnull;
|
|||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
import static org.schabi.newpipe.extractor.utils.Utils.EMPTY_STRING;
|
import static org.schabi.newpipe.extractor.utils.Utils.EMPTY_STRING;
|
||||||
|
|
||||||
@ -328,29 +327,4 @@ public final class SubtitlesStream extends Stream {
|
|||||||
public ItagItem getItagItem() {
|
public ItagItem getItagItem() {
|
||||||
return null;
|
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,6 @@ import org.schabi.newpipe.extractor.services.youtube.ItagItem;
|
|||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
public final class VideoStream extends Stream {
|
public final class VideoStream extends Stream {
|
||||||
public static final String RESOLUTION_UNKNOWN = "";
|
public static final String RESOLUTION_UNKNOWN = "";
|
||||||
@ -483,27 +482,4 @@ public final class VideoStream extends Stream {
|
|||||||
public ItagItem getItagItem() {
|
public ItagItem getItagItem() {
|
||||||
return itagItem;
|
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user