Interface Step

All Superinterfaces:
Identified
All Known Subinterfaces:
NestedPipelineStep
All Known Implementing Classes:
NullStep

public interface Step extends Identified

A processing Step that can be added to a Pipeline. Note that steps themselves are not owned by a pipeline and implementations should be immutable, relatively state-less and reusable. A pipeline will bring steps together in a directed acyclic graph, and call the realize method in dependency order, passing each realized step in to the next.

Realization should return an object that implements exactly one of the FUNCTOR_INTERFACES that is realized using the given inputs. This step should not perform any data processing, it should just validate the inputs against its parameters and produce a functor that will accept data of the type it has been told it will receive (as per the list of RealizedSteps it is given.

  • Field Details

    • FUNCTOR_INTERFACES

      static final Set<Class<?>> FUNCTOR_INTERFACES

      The supported set of interfaces a Step can produce during realization.

  • Method Details

    • getDescription

      RiskscapeMessage getDescription()
      Returns:
      A human digestible description for this step.
    • getDeclaredParameters

      @Deprecated default List<Parameter> getDeclaredParameters()
      Deprecated.
      use getParameterSet() instead
    • getParameterSet

      ParameterSet getParameterSet()

      The set of Parameters this step accepts. These should be used to populate a map for the realize(RealizationInput) method

    • realize

      ResultOrProblems<? extends Realized> realize(RealizationInput stepInput)

      Does the parameter validation required to produce an functor for the next Step.

      Parameters:
      stepInput - the data and context that go in to realizing a step
      Returns:
      a realized functor that will work when given data of the types specified by inputs.
    • getInputArity

      com.google.common.collect.Range<Integer> getInputArity()
      Returns:
      a range that describes the number of inputs this step supports. NB a bit unsure whether we really need this - at the moment it's defined by the functor... but it's possible we might need a n-input join functor...
    • getDeclaredParameter

      default Optional<Parameter> getDeclaredParameter(String name)
    • named

      default NamedStep named(String name)
      Returns:
      a new NamedStep that wraps this Step
    • getInputNames

      default List<String> getInputNames()
      Returns:
      a list of input names, in the order that the step expects. Will be empty for steps that do not support named inputs.
    • getDefaultInputName

      default Optional<String> getDefaultInputName()
      Returns:
      the input name to attach un-named pipeline edges to, if named inputs are supported
    • hasNamedInput

      default boolean hasNamedInput(String namedInput)
      Returns:
      true if this step has a named input that matches namedInput
    • getDeclaredParameterNames

      default List<String> getDeclaredParameterNames()
      Returns:
      a List of the names of parameters that this step declares