Class Options

java.lang.Object
org.apache.hadoop.util.Options

public class Options extends Object
This class allows generic access to variable length type-safe parameter lists.
  • Constructor Details

    • Options

      public Options()
  • Method Details

    • getOption

      public static <base, T extends base> T getOption(Class<T> cls, base[] opts) throws IOException
      Find the first option of the required class.
      Type Parameters:
      T - the static class to find
      base - the parent class of the array
      Parameters:
      cls - the dynamic class to find
      opts - the list of options to look through
      Returns:
      the first option that matches
      Throws:
      IOException - raised on errors performing I/O.
    • prependOptions

      public static <T> T[] prependOptions(T[] oldOpts, T... newOpts)
      Prepend some new options to the old options
      Type Parameters:
      T - the type of options
      Parameters:
      oldOpts - the old options
      newOpts - the new options
      Returns:
      a new array of options