Make some fields final

This commit is contained in:
Coffeemakr 2017-11-30 11:34:26 +01:00
parent 89f8678912
commit 58df281975
No known key found for this signature in database
GPG Key ID: 3F35676D8FF6E743
13 changed files with 22 additions and 21 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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,

View File

@ -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) {

View File

@ -35,7 +35,7 @@ public abstract class SearchEngine {
}
}
private InfoItemSearchCollector collector;
private final InfoItemSearchCollector collector;
public SearchEngine(int serviceId) {
collector = new InfoItemSearchCollector(serviceId);

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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) {