Class DirectoryOptions
java.lang.Object
eu.svjatoslav.commons.cli_helper.parameter_parser.Option<List<File>,DirectoryOptions>
eu.svjatoslav.commons.cli_helper.parameter_parser.parameter.DirectoryOptions
Represents a command-line option that accepts one or more directory paths.
-
Field Summary
Fields inherited from class eu.svjatoslav.commons.cli_helper.parameter_parser.Option
description, mandatory, parameters
-
Constructor Summary
ConstructorsConstructorDescriptionDirectoryOptions
(String description) Creates a DirectoryOptions object with a specified description, requiring one or more directories. -
Method Summary
Modifier and TypeMethodDescriptionDescribes the kind or format of the expected parameter(s), e.g.getValue()
Returns the directories as a list ofFile
objects.boolean
Validates each directory path against the specifiedExistenceType
.Requires that each directory must exist.Requires that each directory must not exist.Methods inherited from class eu.svjatoslav.commons.cli_helper.parameter_parser.Option
addAliases, addParameter, getAliasesAsString, getHelp, isMandatory, isPresent, matchesAlias, noMoreArguments, setMandatory, setPresent
-
Constructor Details
-
DirectoryOptions
Creates a DirectoryOptions object with a specified description, requiring one or more directories.- Parameters:
description
- a brief description of what these directories represent.
-
-
Method Details
-
describeFormat
Description copied from class:Option
Describes the kind or format of the expected parameter(s), e.g. "File", "Integer", etc.- Specified by:
describeFormat
in classOption<List<File>,
DirectoryOptions> - Returns:
- a short string describing the parameter format
-
getValue
Returns the directories as a list ofFile
objects.- Specified by:
getValue
in classOption<List<File>,
DirectoryOptions> - Returns:
- the parsed value as the generic type T.
-
mustExist
Requires that each directory must exist.- Returns:
- this DirectoryOptions instance
-
mustNotExist
Requires that each directory must not exist.- Returns:
- this DirectoryOptions instance
-
isValid
Validates each directory path against the specifiedExistenceType
.- Specified by:
isValid
in classOption<List<File>,
DirectoryOptions> - Parameters:
value
- the parameter string to test- Returns:
true
if valid;false
otherwise
-