public class IdentificationParametersInputBean extends Object
| Constructor and Description |
|---|
IdentificationParametersInputBean(org.apache.commons.cli.CommandLine aLine)
Takes all the arguments from a command line.
|
| Modifier and Type | Method and Description |
|---|---|
File |
getDestinationFile()
Returns the file where to save the identification parameters.
|
IdentificationParameters |
getIdentificationParameters()
Returns the identification parameters.
|
File |
getInputFile()
Returns the input parameters file.
|
static boolean |
inDoubleRange(String argType,
String arg,
double minValue,
double maxValue)
Returns true if the input is a double value inside the given range.
|
static boolean |
inIntegerRange(String argType,
String arg,
int minValue,
int maxValue)
Returns true if the input is an integer value inside the given range.
|
static boolean |
isBooleanInput(String argType,
String arg)
Returns true of the input is 0 or 1.
|
static boolean |
isDouble(String argType,
String arg)
Returns true if the argument can be parsed as a double value.
|
static boolean |
isInList(String argType,
String arg,
List<String> supportedInput)
Returns true of the input is in the provided list.
|
static boolean |
isInteger(String argType,
String arg)
Returns true if the argument can be parsed as an integer value.
|
Boolean |
isListMods()
Indicates whether the modifications should be printed on the screen.
|
static boolean |
isPositiveDouble(String argType,
String arg,
boolean allowZero)
Returns true if the argument can be parsed as a positive double value.
|
static boolean |
isPositiveInteger(String argType,
String arg,
boolean allowZero)
Returns true if the argument can be parsed as a positive integer value.
|
static boolean |
isSequenceMatchingType(String argType,
String arg)
Returns true of the input is in the provided list.
|
static boolean |
isValidModifications(org.apache.commons.cli.CommandLine aLine)
Verifies that modifications are correctly recognized.
|
static boolean |
isValidStartup(org.apache.commons.cli.CommandLine aLine,
boolean checkMandatoryParameters)
Verifies the command line start parameters.
|
void |
setIdentificationParameters(IdentificationParameters identificationParameters)
Sets the identification parameters.
|
void |
updateIdentificationParameters()
Updates the identification parameters according to the command line.
|
public IdentificationParametersInputBean(org.apache.commons.cli.CommandLine aLine)
throws FileNotFoundException,
IOException,
ClassNotFoundException
aLine - the command lineFileNotFoundException - if a FileNotFoundException occursIOException - if an IOException occursClassNotFoundException - if aClassNotFoundException
ClassNotFoundException occurspublic void updateIdentificationParameters()
throws FileNotFoundException,
IOException,
ClassNotFoundException
FileNotFoundException - if a FileNotFoundException occursIOException - if an IOException occursClassNotFoundException - if aClassNotFoundException
ClassNotFoundException occurspublic void setIdentificationParameters(IdentificationParameters identificationParameters)
identificationParameters - the identification parameterspublic IdentificationParameters getIdentificationParameters()
public File getInputFile()
public File getDestinationFile()
public Boolean isListMods()
public static boolean isValidModifications(org.apache.commons.cli.CommandLine aLine)
throws IOException
aLine - the command line to validateIOException - if an IOException occurspublic static boolean isValidStartup(org.apache.commons.cli.CommandLine aLine,
boolean checkMandatoryParameters)
throws IOException
aLine - the command line to validatecheckMandatoryParameters - if true, check if mandatory parameters
are includedIOException - if an IOException occurspublic static boolean isPositiveDouble(String argType, String arg, boolean allowZero)
argType - the name of the argumentarg - the content of the argumentallowZero - if true, zero values are allowedpublic static boolean isPositiveInteger(String argType, String arg, boolean allowZero)
argType - the name of the argumentarg - the content of the argumentallowZero - if true, zero values are allowedpublic static boolean isInteger(String argType, String arg)
argType - the name of the argumentarg - the content of the argumentpublic static boolean isDouble(String argType, String arg)
argType - the name of the argumentarg - the content of the argumentpublic static boolean isBooleanInput(String argType, String arg)
argType - the name of the argumentarg - the content of the argumentpublic static boolean isInList(String argType, String arg, List<String> supportedInput)
argType - the name of the argumentarg - the content of the argumentsupportedInput - the list of supported inputpublic static boolean isSequenceMatchingType(String argType, String arg)
argType - the name of the argumentarg - the content of the argumentpublic static boolean inIntegerRange(String argType, String arg, int minValue, int maxValue)
argType - the name of the argumentarg - the content of the argumentminValue - the minimum value allowedmaxValue - the maximum value allowedpublic static boolean inDoubleRange(String argType, String arg, double minValue, double maxValue)
argType - the name of the argumentarg - the content of the argumentminValue - the minimum value allowedmaxValue - the maximum value allowedCopyright © 2016. All rights reserved.