Add @Nonnull annotations
This commit is contained in:
parent
d0a05706e3
commit
d4b72f539b
|
@ -3,6 +3,7 @@ package org.schabi.newpipe.extractor;
|
|||
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
|
||||
import org.schabi.newpipe.extractor.stream.StreamInfoItemCollector;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -39,7 +40,9 @@ public abstract class ListExtractor extends Extractor {
|
|||
return nextStreamsUrl == null || nextStreamsUrl.isEmpty();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public abstract StreamInfoItemCollector getStreams() throws IOException, ExtractionException;
|
||||
|
||||
public abstract NextItemsResult getNextStreams() throws IOException, ExtractionException;
|
||||
|
||||
public boolean hasMoreStreams() {
|
||||
|
|
|
@ -86,6 +86,7 @@ public class SoundcloudChannelExtractor extends ChannelExtractor {
|
|||
return user.getString("description", "");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public StreamInfoItemCollector getStreams() throws IOException, ExtractionException {
|
||||
StreamInfoItemCollector collector = new StreamInfoItemCollector(getServiceId());
|
||||
|
|
|
@ -50,6 +50,7 @@ public class SoundcloudChartsExtractor extends KioskExtractor {
|
|||
return new NextItemsResult(collector, nextStreamsUrl);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public StreamInfoItemCollector getStreams() throws IOException, ExtractionException {
|
||||
StreamInfoItemCollector collector = new StreamInfoItemCollector(getServiceId());
|
||||
|
|
|
@ -88,6 +88,7 @@ public class SoundcloudPlaylistExtractor extends PlaylistExtractor {
|
|||
return playlist.getNumber("track_count", 0).longValue();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public StreamInfoItemCollector getStreams() throws IOException, ExtractionException {
|
||||
StreamInfoItemCollector collector = new StreamInfoItemCollector(getServiceId());
|
||||
|
|
|
@ -71,7 +71,7 @@ public class SoundcloudStreamExtractor extends StreamExtractor {
|
|||
|
||||
@Override
|
||||
public int getAgeLimit() {
|
||||
return 0;
|
||||
return NO_AGE_LIMIT;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -163,6 +163,7 @@ public class YoutubeChannelExtractor extends ChannelExtractor {
|
|||
}
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public StreamInfoItemCollector getStreams() throws IOException, ExtractionException {
|
||||
StreamInfoItemCollector collector = new StreamInfoItemCollector(getServiceId());
|
||||
|
|
|
@ -143,6 +143,7 @@ public class YoutubePlaylistExtractor extends PlaylistExtractor {
|
|||
}
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public StreamInfoItemCollector getStreams() throws IOException, ExtractionException {
|
||||
StreamInfoItemCollector collector = new StreamInfoItemCollector(getServiceId());
|
||||
|
|
|
@ -167,7 +167,7 @@ public class YoutubeStreamExtractor extends StreamExtractor {
|
|||
@Override
|
||||
public int getAgeLimit() throws ParsingException {
|
||||
if (!isAgeRestricted) {
|
||||
return 0;
|
||||
return NO_AGE_LIMIT;
|
||||
}
|
||||
try {
|
||||
return Integer.valueOf(doc.select("meta[property=\"og:restrictions:age\"]")
|
||||
|
|
|
@ -79,6 +79,7 @@ public class YoutubeTrendingExtractor extends KioskExtractor {
|
|||
}
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public StreamInfoItemCollector getStreams() throws ParsingException {
|
||||
StreamInfoItemCollector collector = new StreamInfoItemCollector(getServiceId());
|
||||
|
|
|
@ -39,6 +39,8 @@ import java.util.List;
|
|||
*/
|
||||
public abstract class StreamExtractor extends Extractor {
|
||||
|
||||
public static final int NO_AGE_LIMIT = 0;
|
||||
|
||||
public StreamExtractor(StreamingService service, String url) throws IOException, ExtractionException {
|
||||
super(service, url);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue