package org.gcube.data.streams.dsl.unfold; import org.gcube.data.streams.Stream; import org.gcube.data.streams.delegates.UnfoldedStream; import org.gcube.data.streams.dsl.StreamClause; import org.gcube.data.streams.dsl.StreamClauseEnv; import org.gcube.data.streams.generators.Generator; /** * The clause of {@code unfold} sentences in which a {@link Generator} is configured on the output stream. * * @author Fabio Simeoni * * @param the type of stream elements */ public class UnfoldThroughClause extends StreamClause> { /** * Creates an instance from an input {@link Stream} * * @param stream the stream */ public UnfoldThroughClause(Stream stream) { super(new StreamClauseEnv(stream)); } /** * Return a {@link Stream} configured with a given {@link Generator}. * * @param generator the generator * @return the stream */ public UnfoldedStream through(Generator> generator) { return new UnfoldedStream(env.stream(), generator); } }