Class ArgumentHelper


  • public class ArgumentHelper
    extends Object
    Utility class to assist in extracting program arguments.
    Since:
    V2.1-A
    Author:
    Derek Hulley
    • Constructor Detail

      • ArgumentHelper

        public ArgumentHelper​(String usage,
                              String[] args)
    • Method Detail

      • getStringValue

        public String getStringValue​(String arg,
                                     boolean mandatory,
                                     boolean nonEmpty)
        Throws:
        IllegalArgumentException - if the argument doesn't match the requirements.
      • getIntegerValue

        public int getIntegerValue​(String arg,
                                   boolean mandatory,
                                   int minValue,
                                   int maxValue)
        Returns:
        Returns the value assigned or the minimum value if the parameter was not present
        Throws:
        IllegalArgumentException - if the argument doesn't match the requirements.
      • printUsage

        public void printUsage()