All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.annot8.common.implementations.pipelines.PipelineBuilder Maven / Gradle / Ivy

There is a newer version: 0.2.0
Show newest version
/* Annot8 (annot8.io) - Licensed under Apache-2.0. */
package io.annot8.common.implementations.pipelines;

import java.util.Arrays;
import java.util.Collection;

import io.annot8.common.implementations.factories.ItemCreator;
import io.annot8.core.components.Processor;
import io.annot8.core.components.Resource;
import io.annot8.core.components.Source;
import io.annot8.core.exceptions.IncompleteException;
import io.annot8.core.settings.Settings;

public interface PipelineBuilder {

  PipelineBuilder withItemQueue(ItemQueue itemQueue);

  PipelineBuilder withItemCreator(ItemCreator itemCreator);

  default PipelineBuilder addResource(
      final String id, final Resource resource, final Settings... settings) {
    addResource(id, resource, Arrays.asList(settings));
    return this;
  }

  default PipelineBuilder addSource(final Source source, final Settings... settings) {
    addSource(source, Arrays.asList(settings));
    return this;
  }

  default PipelineBuilder addProcessor(final Processor processor, final Settings... settings) {
    addProcessor(processor, Arrays.asList(settings));
    return this;
  }

  PipelineBuilder addResource(
      final String id, final Resource resource, final Collection settings);

  PipelineBuilder addSource(final Source source, final Collection settings);

  PipelineBuilder addProcessor(final Processor processor, final Collection settings);

  Pipeline build() throws IncompleteException;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy