Make some fields final
This commit is contained in:
parent
89f8678912
commit
58df281975
13 changed files with 22 additions and 21 deletions
|
@ -16,7 +16,7 @@ public abstract class Info implements Serializable {
|
|||
public final String url;
|
||||
public final String name;
|
||||
|
||||
public List<Throwable> errors = new ArrayList<>();
|
||||
public final List<Throwable> errors = new ArrayList<>();
|
||||
|
||||
public void addError(Throwable throwable) {
|
||||
this.errors.add(throwable);
|
||||
|
|
|
@ -3,9 +3,10 @@ package org.schabi.newpipe.extractor;
|
|||
import org.schabi.newpipe.extractor.stream.SubtitlesFormat;
|
||||
|
||||
public class Subtitles {
|
||||
private SubtitlesFormat format;
|
||||
private String languageCode, URL;
|
||||
private boolean autoGenerated;
|
||||
private final SubtitlesFormat format;
|
||||
private final String languageCode;
|
||||
private final String URL;
|
||||
private final boolean autoGenerated;
|
||||
|
||||
public Subtitles(SubtitlesFormat format, String languageCode, String URL, boolean autoGenerated) {
|
||||
this.format = format;
|
||||
|
|
|
@ -27,7 +27,7 @@ import java.util.List;
|
|||
|
||||
public abstract class SuggestionExtractor {
|
||||
|
||||
private int serviceId;
|
||||
private final int serviceId;
|
||||
|
||||
public SuggestionExtractor(int serviceId) {
|
||||
this.serviceId = serviceId;
|
||||
|
|
|
@ -30,7 +30,7 @@ import java.io.IOException;
|
|||
|
||||
public abstract class KioskExtractor extends ListExtractor {
|
||||
private String contentCountry = null;
|
||||
private String id = null;
|
||||
private final String id;
|
||||
|
||||
public KioskExtractor(StreamingService streamingService,
|
||||
String url,
|
||||
|
|
|
@ -19,8 +19,8 @@ public class KioskList {
|
|||
throws ExtractionException, IOException;
|
||||
}
|
||||
|
||||
private int service_id;
|
||||
private HashMap<String, KioskEntry> kioskList = new HashMap<>();
|
||||
private final int service_id;
|
||||
private final HashMap<String, KioskEntry> kioskList = new HashMap<>();
|
||||
private String defaultKiosk = null;
|
||||
|
||||
private class KioskEntry {
|
||||
|
@ -28,8 +28,8 @@ public class KioskList {
|
|||
extractorFactory = ef;
|
||||
handler = h;
|
||||
}
|
||||
KioskExtractorFactory extractorFactory;
|
||||
UrlIdHandler handler;
|
||||
final KioskExtractorFactory extractorFactory;
|
||||
final UrlIdHandler handler;
|
||||
}
|
||||
|
||||
public KioskList(int service_id) {
|
||||
|
|
|
@ -35,7 +35,7 @@ public abstract class SearchEngine {
|
|||
}
|
||||
}
|
||||
|
||||
private InfoItemSearchCollector collector;
|
||||
private final InfoItemSearchCollector collector;
|
||||
|
||||
public SearchEngine(int serviceId) {
|
||||
collector = new InfoItemSearchCollector(serviceId);
|
||||
|
|
|
@ -4,7 +4,7 @@ import com.grack.nanojson.JsonObject;
|
|||
import org.schabi.newpipe.extractor.channel.ChannelInfoItemExtractor;
|
||||
|
||||
public class SoundcloudChannelInfoItemExtractor implements ChannelInfoItemExtractor {
|
||||
private JsonObject searchResult;
|
||||
private final JsonObject searchResult;
|
||||
|
||||
public SoundcloudChannelInfoItemExtractor(JsonObject searchResult) {
|
||||
this.searchResult = searchResult;
|
||||
|
|
|
@ -9,7 +9,7 @@ public class SoundcloudPlaylistInfoItemExtractor implements PlaylistInfoItemExtr
|
|||
private static final String AVATAR_URL_KEY = "avatar_url";
|
||||
private static final String ARTWORK_URL_KEY = "artwork_url";
|
||||
|
||||
private JsonObject searchResult;
|
||||
private final JsonObject searchResult;
|
||||
|
||||
public SoundcloudPlaylistInfoItemExtractor(JsonObject searchResult) {
|
||||
this.searchResult = searchResult;
|
||||
|
|
|
@ -146,8 +146,8 @@ public class ItagItem {
|
|||
return mediaFormat;
|
||||
}
|
||||
|
||||
public int id;
|
||||
public ItagType itagType;
|
||||
public final int id;
|
||||
public final ItagType itagType;
|
||||
|
||||
// Audio fields
|
||||
public int avgBitrate = -1;
|
||||
|
|
|
@ -26,7 +26,7 @@ import org.schabi.newpipe.extractor.utils.Utils;
|
|||
*/
|
||||
|
||||
public class YoutubeChannelInfoItemExtractor implements ChannelInfoItemExtractor {
|
||||
private Element el;
|
||||
private final Element el;
|
||||
|
||||
public YoutubeChannelInfoItemExtractor(Element el) {
|
||||
this.el = el;
|
||||
|
|
|
@ -6,7 +6,7 @@ import org.schabi.newpipe.extractor.playlist.PlaylistInfoItemExtractor;
|
|||
import org.schabi.newpipe.extractor.utils.Utils;
|
||||
|
||||
public class YoutubePlaylistInfoItemExtractor implements PlaylistInfoItemExtractor {
|
||||
private Element el;
|
||||
private final Element el;
|
||||
|
||||
public YoutubePlaylistInfoItemExtractor(Element el) {
|
||||
this.el = el;
|
||||
|
|
|
@ -13,8 +13,8 @@ public enum SubtitlesFormat {
|
|||
TRANSCRIPT2 (0x3, "srv2"),
|
||||
TRANSCRIPT3 (0x4, "srv3");
|
||||
|
||||
private int id;
|
||||
private String extension;
|
||||
private final int id;
|
||||
private final String extension;
|
||||
|
||||
SubtitlesFormat(int id, String extension) {
|
||||
this.id = id;
|
||||
|
|
|
@ -23,8 +23,8 @@ package org.schabi.newpipe.extractor.stream;
|
|||
import org.schabi.newpipe.extractor.MediaFormat;
|
||||
|
||||
public class VideoStream extends Stream {
|
||||
public String resolution;
|
||||
public boolean isVideoOnly;
|
||||
public final String resolution;
|
||||
public final boolean isVideoOnly;
|
||||
|
||||
|
||||
public VideoStream(String url, MediaFormat format, String resolution) {
|
||||
|
|
Loading…
Reference in a new issue