Skip to content

Commit 301b9fa

Browse files
committed
Remove hashCode and equals methods overrides of Stream classes
1 parent 2f3920c commit 301b9fa

4 files changed

Lines changed: 0 additions & 98 deletions

File tree

extractor/src/main/java/org/schabi/newpipe/extractor/stream/AudioStream.java

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626
import javax.annotation.Nonnull;
2727
import javax.annotation.Nullable;
28-
import java.util.Objects;
2928

3029
public final class AudioStream extends Stream {
3130
public static final int UNKNOWN_BITRATE = -1;
@@ -381,27 +380,4 @@ public String getCodec() {
381380
public ItagItem getItagItem() {
382381
return itagItem;
383382
}
384-
385-
@Override
386-
public boolean equals(final Object obj) {
387-
if (this == obj) {
388-
return true;
389-
}
390-
391-
if (obj == null || getClass() != obj.getClass()) {
392-
return false;
393-
}
394-
395-
if (!super.equals(obj)) {
396-
return false;
397-
}
398-
399-
final AudioStream audioStream = (AudioStream) obj;
400-
return averageBitrate == audioStream.averageBitrate;
401-
}
402-
403-
@Override
404-
public int hashCode() {
405-
return Objects.hash(super.hashCode(), averageBitrate);
406-
}
407383
}

extractor/src/main/java/org/schabi/newpipe/extractor/stream/Stream.java

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import javax.annotation.Nullable;
88
import java.io.Serializable;
99
import java.util.List;
10-
import java.util.Objects;
1110

1211
import static org.schabi.newpipe.extractor.utils.Utils.isNullOrEmpty;
1312

@@ -214,27 +213,4 @@ public String getManifestUrl() {
214213
*/
215214
@Nullable
216215
public abstract ItagItem getItagItem();
217-
218-
@Override
219-
public boolean equals(final Object obj) {
220-
if (this == obj) {
221-
return true;
222-
}
223-
224-
if (obj == null || getClass() != obj.getClass()) {
225-
return false;
226-
}
227-
228-
final Stream stream = (Stream) obj;
229-
return id.equals(stream.id) && mediaFormat == stream.mediaFormat
230-
&& deliveryMethod == stream.deliveryMethod
231-
&& content.equals(stream.content)
232-
&& isUrl == stream.isUrl
233-
&& Objects.equals(manifestUrl, stream.manifestUrl);
234-
}
235-
236-
@Override
237-
public int hashCode() {
238-
return Objects.hash(id, mediaFormat, deliveryMethod, content, isUrl, manifestUrl);
239-
}
240216
}

extractor/src/main/java/org/schabi/newpipe/extractor/stream/SubtitlesStream.java

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import javax.annotation.Nullable;
88

99
import java.util.Locale;
10-
import java.util.Objects;
1110

1211
import static org.schabi.newpipe.extractor.utils.Utils.EMPTY_STRING;
1312

@@ -328,29 +327,4 @@ public Locale getLocale() {
328327
public ItagItem getItagItem() {
329328
return null;
330329
}
331-
332-
@Override
333-
public boolean equals(final Object obj) {
334-
if (this == obj) {
335-
return true;
336-
}
337-
338-
if (obj == null || getClass() != obj.getClass()) {
339-
return false;
340-
}
341-
342-
if (!super.equals(obj)) {
343-
return false;
344-
}
345-
346-
final SubtitlesStream subtitlesStream = (SubtitlesStream) obj;
347-
return autoGenerated == subtitlesStream.autoGenerated
348-
&& locale.equals(subtitlesStream.locale)
349-
&& code.equals(subtitlesStream.code);
350-
}
351-
352-
@Override
353-
public int hashCode() {
354-
return Objects.hash(super.hashCode(), locale, autoGenerated, code);
355-
}
356330
}

extractor/src/main/java/org/schabi/newpipe/extractor/stream/VideoStream.java

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626
import javax.annotation.Nonnull;
2727
import javax.annotation.Nullable;
28-
import java.util.Objects;
2928

3029
public final class VideoStream extends Stream {
3130
public static final String RESOLUTION_UNKNOWN = "";
@@ -483,27 +482,4 @@ public String getCodec() {
483482
public ItagItem getItagItem() {
484483
return itagItem;
485484
}
486-
487-
@Override
488-
public boolean equals(final Object obj) {
489-
if (this == obj) {
490-
return true;
491-
}
492-
493-
if (obj == null || getClass() != obj.getClass()) {
494-
return false;
495-
}
496-
497-
if (!super.equals(obj)) {
498-
return false;
499-
}
500-
501-
final VideoStream videoStream = (VideoStream) obj;
502-
return isVideoOnly == videoStream.isVideoOnly && resolution.equals(videoStream.resolution);
503-
}
504-
505-
@Override
506-
public int hashCode() {
507-
return Objects.hash(super.hashCode(), resolution, isVideoOnly);
508-
}
509485
}

0 commit comments

Comments
 (0)