Interface Pipeline<K,​V>

  • All Known Implementing Classes:
    DefaultPipeline

    public interface Pipeline<K,​V>
    • Method Detail

      • addBefore

        Pipeline<K,​V> addBefore​(String baseName,
                                      String name,
                                      Command<K,​V> command)
        Inserts a Command before an existing command of this pipeline.
        Parameters:
        baseName - the name of the existing command
        name - the name of the command to insert before
        command - the command to insert before
        Throws:
        NoSuchElementException - if there's no such entry with the specified baseName
        IllegalArgumentException - if there's an entry with the same name already in the pipeline
        NullPointerException - if the specified baseName or command is null
      • addAfter

        Pipeline<K,​V> addAfter​(String baseName,
                                     String name,
                                     Command<K,​V> command)
        Inserts a Command after an existing command of this pipeline.
        Parameters:
        baseName - the name of the existing command
        name - the name of the command to insert after
        command - the command to insert after
        Throws:
        NoSuchElementException - if there's no such entry with the specified baseName
        IllegalArgumentException - if there's an entry with the same name already in the pipeline
        NullPointerException - if the specified baseName or command is null
      • remove

        Command<K,​V> remove​(String name)
        Removes the Command with the specified name from this pipeline.
        Parameters:
        name - the name under which the Command was stored.
        Returns:
        the removed command
        Throws:
        NoSuchElementException - if there's no such command with the specified name in this pipeline
        NullPointerException - if the specified name is null
      • remove

        Command<K,​V> remove​(Class commandType)
        Removes the Command of the specified type from this pipeline.
        Parameters:
        commandType - the type of the command
        Returns:
        the removed command
        Throws:
        NoSuchElementException - if there's no such command of the specified type in this pipeline
        NullPointerException - if the specified command type is null
      • first

        Command<K,​V> first()
        Returns the first Command in this pipeline.
        Returns:
        the first command. null if this pipeline is empty.
      • last

        Command<K,​V> last()
        Returns the last Command in this pipeline.
        Returns:
        the last command. null if this pipeline is empty.
      • get

        Command<K,​V> get​(String name)
        Returns the Command with the specified name in this pipeline.
        Returns:
        the command with the specified name. null if there's no such command in this pipeline.
      • get

        <T extends Command<K,​V>> T get​(Class<T> commandType)
        Returns the Command of the specified type in this pipeline.
        Returns:
        the command of the specified command type. null if there's no such command in this pipeline.
      • firstContext

        PipelineProcess<K,​V> firstContext()
        Returns the context of the first Command in this pipeline.
        Returns:
        the context of the first command. null if this pipeline is empty.
      • lastContext

        PipelineProcess<K,​V> lastContext()
        Returns the context of the last Command in this pipeline.
        Returns:
        the context of the last command. null if this pipeline is empty.
      • context

        PipelineProcess<K,​V> context​(Command<K,​V> command)
        Returns the context object of the specified Command in this pipeline.
        Returns:
        the context object of the specified command. null if there's no such command in this pipeline.
      • context

        PipelineProcess<K,​V> context​(String name)
        Returns the context object of the Command with the specified name in this pipeline.
        Returns:
        the context object of the command with the specified name. null if there's no such command in this pipeline.
      • context

        PipelineProcess<K,​V> context​(Class<? extends Command> commandType)
        Returns the context object of the Command of the specified type in this pipeline.
        Returns:
        the context object of the command of the specified type. null if there's no such command in this pipeline.
      • toMap

        Map<String,​Command<K,​V>> toMap()
        Converts this pipeline into an ordered Map whose keys are command names and whose values are commands.