org.apache.hadoop.util
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.
|
Method Summary |
static
|
getOption(Class<T> cls,
base[] opts)
Find the first option of the required class. |
static
|
prependOptions(T[] oldOpts,
T... newOpts)
Prepend some new options to the old options |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Options
public Options()
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 findbase - the parent class of the array- Parameters:
cls - the dynamic class to findopts - the list of options to look through
- Returns:
- the first option that matches
- Throws:
IOException
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 optionsnewOpts - the new options
- Returns:
- a new array of options
Copyright © 2013 Apache Software Foundation. All Rights Reserved.