Package ghidra.app.util
Class OptionUtils
java.lang.Object
ghidra.app.util.OptionUtils
Utility class for providing convenience methods for working with
Option
's.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
containsOption
(String optionName, List<Option> options) Checks to see whether or not the given list of options contains the given option name.static boolean
getBooleanOptionValue
(String optionName, List<Option> options, boolean defaultValue) Gets the boolean value of the option with the given name from the given list of options.static <T> T
Gets the value of the option with the given name from the given list of options.
-
Constructor Details
-
OptionUtils
public OptionUtils()
-
-
Method Details
-
containsOption
Checks to see whether or not the given list of options contains the given option name.- Parameters:
optionName
- The name of the option to check.options
- A list of the all the options.- Returns:
- True if the given list contains the given option; otherwise, false.
-
getOption
Gets the value of the option with the given name from the given list of options.- Parameters:
optionName
- The name of the option to get.options
- The list of options to get the option from.defaultValue
- A default option value to use if the option name was not found.- Returns:
- The value of the option with the given name, or the default value if it was not found.
-
getBooleanOptionValue
public static boolean getBooleanOptionValue(String optionName, List<Option> options, boolean defaultValue) Gets the boolean value of the option with the given name from the given list of options.- Parameters:
optionName
- The name of the boolean option to get.options
- The list of options to get the option from.defaultValue
- A default option value to use if the option name was not found.- Returns:
- The boolean value of the option with the given name, or the default value if it was not found as a boolean option.
-