Add deprecated old method calls to avoid breaking API

This commit is contained in:
Fynn Godau 2021-04-01 22:31:01 +02:00
parent 14f6f1b7c3
commit c877712647
3 changed files with 40 additions and 0 deletions

View file

@ -337,6 +337,22 @@ public abstract class StreamExtractor extends Extractor {
public abstract InfoItemsCollector<? extends InfoItem, ? extends InfoItemExtractor>
getRelatedItems() throws IOException, ExtractionException;
/**
* @deprecated Use {@link #getRelatedItems()}. May be removed in a future version.
* @return The result of {@link #getRelatedItems()} if it is a
* StreamInfoItemsCollector, null otherwise
* @throws IOException
* @throws ExtractionException
*/
@Deprecated
@Nullable
public StreamInfoItemsCollector getRelatedStreams() throws IOException, ExtractionException {
InfoItemsCollector<?, ?> collector = getRelatedItems();
if (collector instanceof StreamInfoItemsCollector) {
return (StreamInfoItemsCollector) collector;
} else return null;
}
/**
* Should return a list of Frameset object that contains preview of stream frames
*

View file

@ -606,10 +606,26 @@ public class StreamInfo extends Info {
return relatedItems;
}
/**
* @deprecated Use {@link #getRelatedItems()}
*/
@Deprecated
public List<InfoItem> getRelatedStreams() {
return getRelatedItems();
}
public void setRelatedItems(List<InfoItem> relatedItems) {
this.relatedItems = relatedItems;
}
/**
* @deprecated Use {@link #setRelatedItems(List)}
*/
@Deprecated
public void setRelatedStreams(List<InfoItem> relatedItems) {
setRelatedItems(relatedItems);
}
public long getStartPosition() {
return startPosition;
}

View file

@ -41,4 +41,12 @@ public class ExtractorHelper {
}
}
/**
* @deprecated Use {@link #getRelatedItemsOrLogError(StreamInfo, StreamExtractor)}
*/
@Deprecated
public static List<InfoItem> getRelatedVideosOrLogError(StreamInfo info, StreamExtractor extractor) {
return getRelatedItemsOrLogError(info, extractor);
}
}