Class OptionsHelper


  • public class OptionsHelper
    extends java.lang.Object
    Simple utility to parse and retrieve command line options.
    • Constructor Summary

      Constructors 
      Constructor Description
      OptionsHelper()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String get​(java.lang.String optionKey)
      Retrieves option value corresponding to given key.
      boolean isSet​(java.lang.String optionName)
      Verifies if an option by the given name is present.
      void load​(java.lang.String[] input)
      Parses options from the given list of strings.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • OptionsHelper

        public OptionsHelper()
    • Method Detail

      • load

        public void load​(java.lang.String[] input)
                  throws java.lang.Exception
        Parses options from the given list of strings.
        Parameters:
        input - string array containing options. It is expected to be of the format: input[x] == "--optName", input[x + 1] == "optValue"
        Throws:
        java.lang.Exception
      • get

        public java.lang.String get​(java.lang.String optionKey)
        Retrieves option value corresponding to given key.
        Parameters:
        optionKey - name of the option
        Returns:
        String option value
      • isSet

        public boolean isSet​(java.lang.String optionName)
        Verifies if an option by the given name is present.
        Parameters:
        optionName - name of the options
        Returns:
        boolean