Class OptionUtils

java.lang.Object
ghidra.app.util.OptionUtils

public class OptionUtils extends Object
Utility class for providing convenience methods for working with Option's.
  • Constructor Details

    • OptionUtils

      public OptionUtils()
  • Method Details

    • containsOption

      public static boolean containsOption(String optionName, List<Option> options)
      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

      public static <T> T getOption(String optionName, List<Option> options, T defaultValue)
      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.