Use List.of().

This commit is contained in:
Isira Seneviratne
2022-07-20 04:39:11 +05:30
parent c53143ef4f
commit ca26fcb0eb
17 changed files with 75 additions and 102 deletions
@@ -16,7 +16,6 @@ import org.schabi.newpipe.player.playqueue.events.SelectEvent;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
@@ -264,7 +263,7 @@ public abstract class PlayQueue implements Serializable {
* @param items {@link PlayQueueItem}s to append
*/
public synchronized void append(@NonNull final PlayQueueItem... items) {
append(Arrays.asList(items));
append(List.of(items));
}
/**
@@ -4,20 +4,19 @@ import org.schabi.newpipe.extractor.stream.StreamInfo;
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public final class SinglePlayQueue extends PlayQueue {
public SinglePlayQueue(final StreamInfoItem item) {
super(0, Collections.singletonList(new PlayQueueItem(item)));
super(0, List.of(new PlayQueueItem(item)));
}
public SinglePlayQueue(final StreamInfo info) {
super(0, Collections.singletonList(new PlayQueueItem(info)));
super(0, List.of(new PlayQueueItem(info)));
}
public SinglePlayQueue(final StreamInfo info, final long startPosition) {
super(0, Collections.singletonList(new PlayQueueItem(info)));
super(0, List.of(new PlayQueueItem(info)));
getItem().setRecoveryPosition(startPosition);
}