* In services which there's no other way to retrieve them, null should be returned.
*
* @return a {@link FeedExtractor} instance or null.
*/
@Nullable
- public FeedExtractor getFeedExtractor(String url) throws ExtractionException {
+ public FeedExtractor getFeedExtractor(final String url) throws ExtractionException {
return null;
}
/**
* Must create a new instance of a KioskList implementation.
* @return a new KioskList instance
- * @throws ExtractionException
*/
public abstract KioskList getKioskList() throws ExtractionException;
@@ -195,49 +200,52 @@ public abstract class StreamingService {
* Must create a new instance of a ChannelExtractor implementation.
* @param linkHandler is pointing to the channel which should be handled by this new instance.
* @return a new ChannelExtractor
- * @throws ExtractionException
*/
- public abstract ChannelExtractor getChannelExtractor(ListLinkHandler linkHandler) throws ExtractionException;
+ public abstract ChannelExtractor getChannelExtractor(ListLinkHandler linkHandler)
+ throws ExtractionException;
/**
* Must crete a new instance of a PlaylistExtractor implementation.
* @param linkHandler is pointing to the playlist which should be handled by this new instance.
* @return a new PlaylistExtractor
- * @throws ExtractionException
*/
- public abstract PlaylistExtractor getPlaylistExtractor(ListLinkHandler linkHandler) throws ExtractionException;
+ public abstract PlaylistExtractor getPlaylistExtractor(ListLinkHandler linkHandler)
+ throws ExtractionException;
/**
* Must create a new instance of a StreamExtractor implementation.
* @param linkHandler is pointing to the stream which should be handled by this new instance.
* @return a new StreamExtractor
- * @throws ExtractionException
*/
- public abstract StreamExtractor getStreamExtractor(LinkHandler linkHandler) throws ExtractionException;
+ public abstract StreamExtractor getStreamExtractor(LinkHandler linkHandler)
+ throws ExtractionException;
- public abstract CommentsExtractor getCommentsExtractor(ListLinkHandler linkHandler) throws ExtractionException;
+ public abstract CommentsExtractor getCommentsExtractor(ListLinkHandler linkHandler)
+ throws ExtractionException;
/*//////////////////////////////////////////////////////////////////////////
// Extractors without link handler
//////////////////////////////////////////////////////////////////////////*/
- public SearchExtractor getSearchExtractor(String query,
- List
*
*/
@@ -333,8 +342,9 @@ public abstract class StreamingService {
}
// Fallback to the first supported language that matches the preferred language
- for (Localization supportedLanguage : getSupportedLocalizations()) {
- if (supportedLanguage.getLanguageCode().equals(preferredLocalization.getLanguageCode())) {
+ for (final Localization supportedLanguage : getSupportedLocalizations()) {
+ if (supportedLanguage.getLanguageCode()
+ .equals(preferredLocalization.getLanguageCode())) {
return supportedLanguage;
}
}
@@ -343,8 +353,8 @@ public abstract class StreamingService {
}
/**
- * Returns the country that should be used to fetch content in this service. It will get which country
- * the user prefer (using {@link NewPipe#getPreferredContentCountry()}), then it will:
+ * Returns the country that should be used to fetch content in this service. It will get which
+ * country the user prefer (using {@link NewPipe#getPreferredContentCountry()}), then it will:
*
*
- *
- * Just like {@link #getLocalization()}, it will also try to fallback to a less specific localization if
- * the exact one is not available/supported.
+ * Get an instance of the time ago parser using the patterns related to the passed localization.
+ *
+ * Just like {@link #getLocalization()}, it will also try to fallback to a less specific
+ * localization if the exact one is not available/supported.
*
- * @throws IllegalArgumentException if the localization is not supported (parsing patterns are not present).
+ * @throws IllegalArgumentException if the localization is not supported (parsing patterns are
+ * not present).
*/
- public TimeAgoParser getTimeAgoParser(Localization localization) {
+ public TimeAgoParser getTimeAgoParser(final Localization localization) {
final TimeAgoParser targetParser = TimeAgoPatternsManager.getTimeAgoParserFor(localization);
if (targetParser != null) {
@@ -376,15 +387,18 @@ public abstract class StreamingService {
}
if (!localization.getCountryCode().isEmpty()) {
- final Localization lessSpecificLocalization = new Localization(localization.getLanguageCode());
- final TimeAgoParser lessSpecificParser = TimeAgoPatternsManager.getTimeAgoParserFor(lessSpecificLocalization);
+ final Localization lessSpecificLocalization
+ = new Localization(localization.getLanguageCode());
+ final TimeAgoParser lessSpecificParser
+ = TimeAgoPatternsManager.getTimeAgoParserFor(lessSpecificLocalization);
if (lessSpecificParser != null) {
return lessSpecificParser;
}
}
- throw new IllegalArgumentException("Localization is not supported (\"" + localization.toString() + "\")");
+ throw new IllegalArgumentException(
+ "Localization is not supported (\"" + localization + "\")");
}
}