Package org.obolibrary.robot
Class OptionsHelper
- java.lang.Object
-
- org.obolibrary.robot.OptionsHelper
-
public class OptionsHelper extends Object
Provides convenience methods for getting options.
-
-
Constructor Summary
Constructors Constructor Description OptionsHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
getOption(Map<String,String> options, String key)
Given a map of options and a key name, return the value, or null if it is not specified.static String
getOption(Map<String,String> options, String key, String defaultValue)
Given a map of options, a key name, and a default value, if the map contains the key, return its value, otherwise return the default value.
-
-
-
Method Detail
-
getOption
public static String getOption(Map<String,String> options, String key)
Given a map of options and a key name, return the value, or null if it is not specified.- Parameters:
options
- a map of optionskey
- the name of the option to get- Returns:
- the value, if set, otherwise null
-
getOption
public static String getOption(Map<String,String> options, String key, String defaultValue)
Given a map of options, a key name, and a default value, if the map contains the key, return its value, otherwise return the default value.- Parameters:
options
- a map of optionskey
- the name of the option to getdefaultValue
- the value to return if the key is not set- Returns:
- the value, if set, otherwise the default value
-
-