package org.gcube.smartgears.handlers.application; import java.util.Collections; import java.util.List; import org.gcube.smartgears.handlers.Pipeline; /** * A {@link Pipeline} of {@link ApplicationHandler}s. * * @author Fabio Simeoni * * @param the type of the handlers * * */ public class ApplicationPipeline> extends Pipeline,H> { /** * Creates an instance with a given list of handlers. *

* Modification to the input list do not affect the pipeline. * * @param handlers the handlers */ public ApplicationPipeline(List handlers) { super(handlers); } /** * Returns a pipeline with the same handlers as this pipeline but in reverse order. * @return the reversed pipeline */ public ApplicationPipeline reverse() { List handlers = handlers(); // it's a copy, we're not changing this pipeline Collections.reverse(handlers); return new ApplicationPipeline(handlers); } }