public class CommandParameter extends Object
Constructor and Description |
---|
CommandParameter() |
Modifier and Type | Method and Description |
---|---|
static boolean |
fileExists(String argType,
String arg)
Returns true if the argument can be parsed as a file and the file exists.
|
static boolean |
fileExists(String argType,
String arg,
HashSet<String> formats)
Returns true if the argument can be parsed as a file, the file exists and
is in the specified format.
|
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.
|
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.
|
public 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 allowedpublic 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 isBooleanInput(String argType, String arg)
argType
- the name of the argumentarg
- the content of the argumentpublic static boolean isInteger(String argType, String arg)
argType
- the name of the argumentarg
- the content of the argumentpublic static boolean isSequenceMatchingType(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 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 fileExists(String argType, String arg)
argType
- the name of the argumentarg
- the content of the argumentpublic static boolean fileExists(String argType, String arg, HashSet<String> formats)
argType
- the name of the argumentarg
- the content of the argumentformats
- The formats allowed as a list, ignored if nullCopyright © 2018. All rights reserved.