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