Class FileNamerContext

Object
FileNamerContext

public final class FileNamerContext extends Object
Provides useful additional objects when assigning a name to a file.
Author:
Owen Feehan
  • Constructor Details

    • FileNamerContext

      public FileNamerContext(Logger logger)
      Creates with a logger, and otherwise uses sensible defaults.
      Parameters:
      logger - the logger.
    • FileNamerContext

      public FileNamerContext(Optional<Path> inputDirectory, boolean relativeToDirectory, Optional<IndexRangeNegative> nameSubrange, Logger logger)
      Creates with specific parameters.
      Parameters:
      inputDirectory - a directory associated with the inputs, which if defined, is guaranteed to be a parent of them all.
      relativeToDirectory - if true, the namer should prefer to derive file-names relative to the directory, rather than only the varying elements in the file-names.
      nameSubrange - if defined, this indicates and specifies only a subset of the naming-elements to use.
      logger - the logger.
    • FileNamerContext

      public FileNamerContext(String elseName, Logger logger)
      Creates with a fallback-name and a logger, but otherwise using sensible defaults.
      Parameters:
      elseName - a fallback-name, if a failure occurs when naming.
      logger - the logger.
    • FileNamerContext

      public FileNamerContext(Optional<Path> inputDirectory, boolean relativeToDirectory, String elseName, Optional<IndexRangeNegative> nameSubrange, Logger logger)
      Creates a new FileNamerContext instance.
      Parameters:
      inputDirectory - A directory associated with the inputs, which if defined, is guaranteed to be a parent of them all.
      relativeToDirectory - If true, the namer should prefer to derive file-names relative to the directory, rather than only the varying elements in the file-names.
      elseName - A fallback name, if a failure occurs when naming.
      nameSubrange - If defined, this indicates and specifies only a subset of the naming-elements to use.
      logger - Logs information messages.
  • Method Details

    • getInputDirectory

      public Optional<Path> getInputDirectory()
      A directory associated with the inputs, which if defined, is guaranteed to be a parent of them all.
    • isRelativeToDirectory

      public boolean isRelativeToDirectory()
      If true, the namer should prefer to derive file-names relative to the directory, rather than only the varying elements in the file-names.
    • getElseName

      public String getElseName()
      A fallback name, if a failure occurs when naming.
    • getNameSubrange

      public Optional<IndexRangeNegative> getNameSubrange()
      If defined, this indicates and specifies only a subset of the naming-elements to use.
    • getLogger

      public Logger getLogger()
      Logs information messages.
    • 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