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

public class FileOption extends Option<File,FileOption>
This class represents commandline option which accepts exactly one parameter which is a file.
  • Constructor Details

    • FileOption

      public FileOption(String description)
  • Method Details

    • validateFile

      protected static boolean validateFile(ExistenceType existenceType, String value)
    • describeFormat

      public String describeFormat()
      Specified by:
      describeFormat in class Option<File,FileOption>
      Returns:
      Single line parameter type description. For example: "file", "date", "integer", "regular expression", etc..

      Note: for argument purpose description there is Option.description

    • getValue

      public File getValue()
      Description copied from class: Option
      Returns the value of the object.
      Specified by:
      getValue in class Option<File,FileOption>
      Returns:
      the value of the object.
    • mustExist

      public FileOption mustExist()
      This method sets that file shall exist.
      Returns:
      This object.
    • mustNotExist

      public FileOption mustNotExist()
      This method sets that file shall not exist.
      Returns:
      This object.
    • isValid

      public boolean isValid(String value)
      Specified by:
      isValid in class Option<File,FileOption>
      Parameters:
      value - value to validate
      Returns:
      true if value is correct, false otherwise.