java.lang.Object
eu.svjatoslav.commons.cli_helper.parameter_parser.Option<List<File>,FileOptions>
eu.svjatoslav.commons.cli_helper.parameter_parser.parameter.FileOptions

public class FileOptions extends Option<List<File>,FileOptions>
Represents a command-line option that accepts one or more file paths.
  • Constructor Details

    • FileOptions

      public FileOptions(String description)
      Constructs a FileOptions object.
      Parameters:
      description - a brief description of the option's purpose.
  • Method Details

    • describeFormat

      public String describeFormat()
      Provides a short description of the expected file format(s).
      Specified by:
      describeFormat in class Option<List<File>,FileOptions>
      Returns:
      either "One to many existing files.", "One to many non-existing files.", or "One to many files."
    • getValue

      public List<File> getValue()
      Returns the list of file paths as File objects.
      Specified by:
      getValue in class Option<List<File>,FileOptions>
      Returns:
      a list of File objects corresponding to user input.
    • mustExist

      public FileOptions mustExist()
      Requires that each file must already exist.
      Returns:
      this FileOptions instance for chaining
    • mustNotExist

      public FileOptions mustNotExist()
      Requires that each file must not already exist.
      Returns:
      this FileOptions instance for chaining
    • isValid

      public boolean isValid(String value)
      Validates a single file path against the configured existence type.
      Specified by:
      isValid in class Option<List<File>,FileOptions>
      Parameters:
      value - the parameter string to test
      Returns:
      true if valid; false otherwise