org.apache.hadoop.util
Class Options

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

public class Options
extends Object

This class allows generic access to variable length type-safe parameter lists.


Nested Class Summary
static class Options.BooleanOption
           
static class Options.ClassOption
           
static class Options.FSDataInputStreamOption
           
static class Options.FSDataOutputStreamOption
           
static class Options.IntegerOption
           
static class Options.LongOption
           
static class Options.PathOption
           
static class Options.ProgressableOption
           
static class Options.StringOption
           
 
Constructor Summary
Options()
           
 
Method Summary
static
<base,T extends base>
T
getOption(Class<T> cls, base[] opts)
          Find the first option of the required class.
static
<T> T[]
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
 

Constructor Detail

Options

public Options()
Method Detail

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

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


Copyright © 2013 Apache Software Foundation. All Rights Reserved.