public interface CliOptionBuilder
| Modifier and Type | Method and Description |
|---|---|
CliOptionBuilder |
addValidation(java.util.function.Predicate<Cli> validationRule,
java.util.function.Function<Cli,String> errorMessageFunction)
Add an additional validation rule to this option Builder.
|
CliOptionBuilder |
addValidation(java.util.function.Predicate<Cli> validationRule,
String errorMessage)
Add an additional validation rule to this option Builder.
|
CliOptionBuilder |
setRequired(boolean isRequired)
Is this Option required.
|
CliOptionBuilder setRequired(boolean isRequired)
isRequired - true if this option is required; false otherwise.CliOptionBuilder addValidation(java.util.function.Predicate<Cli> validationRule, String errorMessage)
validationRule - A Predicate function that passes in the
parsed Cli instance from a program invocation
that will return true if this Cli passes this new validation
rule; false otherwise. This Predicate can not be null.errorMessage - The message to use in the new CliValidationException
that will be thrown if the given predicate returns false.NullPointerException - if validationRule is null.CliOptionBuilder addValidation(java.util.function.Predicate<Cli> validationRule, java.util.function.Function<Cli,String> errorMessageFunction)
validationRule - A Predicate function that passes in the
parsed Cli instance from a program invocation
that will return true if this Cli passes this new validation
rule; false otherwise. This Predicate can not be null.errorMessageFunction - A function to generate the message to use in the new CliValidationException
that will be thrown if the given predicate returns false.NullPointerException - if either parameter is null.Copyright © 2019 NIH/NCATS. All rights reserved.