Class OutputterTarget

Object
OutputterTarget

public final class OutputterTarget extends Object
The directory and prefix an outputter writes to.

This class is immutable.

Author:
Owen Feehan
  • Constructor Details

    • OutputterTarget

      public OutputterTarget(DirectoryWithPrefix directory, DirectoryCreationParameters parameters) throws BindFailedException
      Creates for a particular directory, with optionally an associated prefix.
      Parameters:
      directory - the directory to output, with optionally an associated prefix.
      parameters - parameters that influence how the directory is created.
      Throws:
      BindFailedException - if the directory cannot be successfully used as an output target.
  • Method Details

    • changePrefix

      public OutputterTarget changePrefix(DirectoryWithPrefix prefixToAssign) throws BindFailedException
      Creates a new OutputterTarget with a changed prefix.

      The directory-component of the prefix must be equal to or a subdirectory of the existing directory.

      Parameters:
      prefixToAssign - the prefix to assign
      Returns:
      a new shallow-copied OutputterTarget but instead with prefixToAssign.
      Throws:
      BindFailedException - if the subdirectory cannot be outputted to
    • getParentDirectoryCreator

      public Optional<WriterExecuteBeforeEveryOperation> getParentDirectoryCreator()
      Parent directory creator to be executed before any derived sub-directories.
      Returns:
      an operation writer, if it exists.
    • getDirectory

      public Path getDirectory()
      The directory into which outputting occurs.
      Returns:
      a path to the directory.
    • pathCreator

      public PathCreator pathCreator()
      Creates the path into which output is written.
      Returns:
      an instance can determine the direction into which output is written.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getPrefix

      public DirectoryWithPrefix getPrefix()
      The directory and prefix into which outputting occurs.