Minor refactoring in Stream.java

pull/1323/head
David Asunmo 2025-07-08 12:48:05 +01:00
rodzic 6b6ae8bff0
commit d600f8d5ec
1 zmienionych plików z 5 dodań i 6 usunięć

Wyświetl plik

@ -68,7 +68,7 @@ public abstract class Stream implements Serializable {
* @param streamList the list of {@link Stream}s which will be compared * @param streamList the list of {@link Stream}s which will be compared
* @return whether the list already contains one stream with equals stats * @return whether the list already contains one stream with equals stats
*/ */
public static boolean containSimilarStream(final Stream stream, public static boolean containSimilarStream(@Nonnull final Stream stream,
final List<? extends Stream> streamList) { final List<? extends Stream> streamList) {
if (isNullOrEmpty(streamList)) { if (isNullOrEmpty(streamList)) {
return false; return false;
@ -98,10 +98,8 @@ public abstract class Stream implements Serializable {
* @return whether the stream have the same stats or not, based on the criteria above * @return whether the stream have the same stats or not, based on the criteria above
*/ */
public boolean equalStats(@Nullable final Stream other) { public boolean equalStats(@Nullable final Stream other) {
if (other == null || mediaFormat == null || other.mediaFormat == null) { return other != null && mediaFormat != null && other.mediaFormat != null
return false; && mediaFormat.id == other.mediaFormat.id && deliveryMethod == other.deliveryMethod
}
return mediaFormat.id == other.mediaFormat.id && deliveryMethod == other.deliveryMethod
&& isUrl == other.isUrl; && isUrl == other.isUrl;
} }
@ -137,6 +135,7 @@ public abstract class Stream implements Serializable {
* *
* @return the content or URL * @return the content or URL
*/ */
@Nonnull
public String getContent() { public String getContent() {
return content; return content;
} }