Package com.vmware.apputils
Class OptionsHelper
- java.lang.Object
-
- com.vmware.apputils.OptionsHelper
-
public class OptionsHelper extends java.lang.ObjectSimple 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.Stringget(java.lang.String optionKey)Retrieves option value corresponding to given key.booleanisSet(java.lang.String optionName)Verifies if an option by the given name is present.voidload(java.lang.String[] input)Parses options from the given list of strings.
-
-
-
Method Detail
-
load
public void load(java.lang.String[] input) throws java.lang.ExceptionParses 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
-
-