com.cloudera.sqoop.cli
Class ToolOptions

java.lang.Object
  extended by com.cloudera.sqoop.cli.ToolOptions
All Implemented Interfaces:
java.lang.Iterable<RelatedOptions>

public class ToolOptions
extends java.lang.Object
implements java.lang.Iterable<RelatedOptions>

Class that holds several sets of related options, providing a container for all the options associated with a single tool. The order in which sets of related options are added to this tool is preserved in printing and iteration.


Constructor Summary
ToolOptions()
           
 
Method Summary
 void addOptions(RelatedOptions opts)
          Add a block of related options to the options for this tool.
 void addUniqueOptions(RelatedOptions opts)
          Add a block of related options to the options for this tool, if a block has not already been added with the same title.
 boolean containsGroup(java.lang.String title)
          Reports whether this collection of RelatedOptions contains a RelatedOptions with the specified title.
 java.util.Iterator<RelatedOptions> iterator()
          Provide an iterator over all sets of RelatedOptions.
 org.apache.commons.cli.Options merge()
          Flatten the different sets of related options into a single collection of options.
 void printHelp()
          Print the help to the console using a default help formatter.
 void printHelp(org.apache.commons.cli.HelpFormatter formatter)
          Print the help to the console using the specified help formatter.
 void printHelp(org.apache.commons.cli.HelpFormatter formatter, java.io.PrintWriter pw)
          Print the help to the specified PrintWriter, using the specified help formatter.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ToolOptions

public ToolOptions()
Method Detail

addOptions

public void addOptions(RelatedOptions opts)
Add a block of related options to the options for this tool.

Parameters:
opts - the set of RelatedOptions to add.

addUniqueOptions

public void addUniqueOptions(RelatedOptions opts)
Add a block of related options to the options for this tool, if a block has not already been added with the same title.

Parameters:
opts - the set of RelatedOptions to add.

containsGroup

public boolean containsGroup(java.lang.String title)
Reports whether this collection of RelatedOptions contains a RelatedOptions with the specified title.

Parameters:
title - the group title to search for
Returns:
true if a RelatedOptions with this group title is in the collection.

iterator

public java.util.Iterator<RelatedOptions> iterator()
Provide an iterator over all sets of RelatedOptions.

Specified by:
iterator in interface java.lang.Iterable<RelatedOptions>
Returns:
an iterator returning each RelatedOptions element.

merge

public org.apache.commons.cli.Options merge()
Flatten the different sets of related options into a single collection of options.

Returns:
all options in the ToolOptions as a single set

printHelp

public void printHelp()
Print the help to the console using a default help formatter.


printHelp

public void printHelp(org.apache.commons.cli.HelpFormatter formatter)
Print the help to the console using the specified help formatter.

Parameters:
formatter - the HelpFormatter to use.

printHelp

public void printHelp(org.apache.commons.cli.HelpFormatter formatter,
                      java.io.PrintWriter pw)
Print the help to the specified PrintWriter, using the specified help formatter.

Parameters:
formatter - the HelpFormatter to use.
pw - the PrintWriter to emit to.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2010 Cloudera, Inc.