nl.vpro.domain.subtitles.ParseResult Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of subtitles-domain Show documentation
Show all versions of subtitles-domain Show documentation
Subtitles are related to media, but are implemented completely parallel. Classes to contain, parse, and assemble subtitle objects are here.
package nl.vpro.domain.subtitles;
import lombok.Getter;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.stream.Collector;
import java.util.stream.Stream;
import org.checkerframework.checker.nullness.qual.NonNull;
/**
* @author Michiel Meeuwissen
* @since 5.11
*/
@Getter
public class ParseResult implements Iterable {
private final List headers;
@NonNull
private final Stream cues;
private ParseResult(Stream cues, List headers) {
this.cues = cues;
this.headers = headers;
}
private ParseResult(Stream cues) {
this(cues, new ArrayList<>());
}
public static ParseResult of(Stream cues) {
return new ParseResult(cues);
}
public static ParseResult of(Stream cues, List headers) {
return new ParseResult(cues, headers);
}
@Override
@NonNull
public Iterator iterator() {
return cues.iterator();
}
public R collect(Collector super Cue, A, R> collector) {
return cues.collect(collector);
}
@Override
public String toString() {
return "headers: " + headers;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy