Class OptionsHelper


  • public class OptionsHelper
    extends Object
    Provides convenience methods for getting options.
    • Constructor Detail

      • OptionsHelper

        public OptionsHelper()
    • 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 options
        key - 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 options
        key - the name of the option to get
        defaultValue - the value to return if the key is not set
        Returns:
        the value, if set, otherwise the default value