public class CliUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static boolean |
isValidPartitionNumber(java.lang.String partition)
This method returns if a partition provided by the command line is valid
|
static void |
printUsageAndFinish(joptsimple.OptionParser parser,
java.lang.String message)
This method is invoked when the command line made up by options and argument
are ill formed or do not meet options spec.
|
static void |
printUsageAndFinish(joptsimple.OptionParser parser,
java.lang.String message,
java.lang.Exception exception)
This method is invoked when the command line made up by options and argument
are ill formed or do not meet options spec.
|
static void |
printUsageAndFinish(java.lang.String executionResult)
Prints usage and exits without system error
|
static java.util.Properties |
stringToMap(java.lang.String commaSeparatedValue)
Get properties from comma-separated config String
|
static void |
validateMandatoryOperationArgs(CommandLineOperation operationArgument,
joptsimple.OptionParser parser,
joptsimple.OptionSet options)
This method validate the mandatory arguments for a specific operation
|
public static void printUsageAndFinish(java.lang.String executionResult)
executionResult
- It represents the result of a command line operationpublic static void printUsageAndFinish(joptsimple.OptionParser parser, java.lang.String message)
parser
- The utility capable to show the usagemessage
- Message Errorpublic static void printUsageAndFinish(joptsimple.OptionParser parser, java.lang.String message, java.lang.Exception exception)
parser
- The utility capable to show the usagemessage
- Message Errorexception
- exception that caused this errorpublic static void validateMandatoryOperationArgs(CommandLineOperation operationArgument, joptsimple.OptionParser parser, joptsimple.OptionSet options)
operationArgument
- It represents a instance of --operation argumentparser
- The utility capable to show the usageoptions
- Represents the set of options in the command linepublic static java.util.Properties stringToMap(java.lang.String commaSeparatedValue)
commaSeparatedValue
- comma-separated values key1=vale1,key2=value2,...,keyN=valueNpublic static boolean isValidPartitionNumber(java.lang.String partition)
partition
- An argument for partition number.