org.apache.commons.cli2.builder
Class GroupBuilder

java.lang.Object
  extended by org.apache.commons.cli2.builder.GroupBuilder

public class GroupBuilder
extends Object

Builds Group instances


Constructor Summary
GroupBuilder()
          Creates a new GroupBuilder
 
Method Summary
 Group create()
          Creates a new Group instance
 GroupBuilder reset()
          Resets the builder.
 GroupBuilder withDescription(String newDescription)
          Use this option description.
 GroupBuilder withMaximum(int newMaximum)
          A valid group requires at most this many options present
 GroupBuilder withMinimum(int newMinimum)
          A valid group requires at least this many options present
 GroupBuilder withName(String newName)
          Use this option name
 GroupBuilder withOption(Option option)
          Add this option to the group
 GroupBuilder withRequired(boolean newRequired)
          Sets the required flag.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroupBuilder

public GroupBuilder()
Creates a new GroupBuilder

Method Detail

create

public Group create()
Creates a new Group instance

Returns:
the new Group instance

reset

public GroupBuilder reset()
Resets the builder.

Returns:
this builder

withDescription

public GroupBuilder withDescription(String newDescription)
Use this option description.

Parameters:
newDescription - the description to use
Returns:
this builder

withName

public GroupBuilder withName(String newName)
Use this option name

Parameters:
newName - the name to use
Returns:
this builder

withMinimum

public GroupBuilder withMinimum(int newMinimum)
A valid group requires at least this many options present

Parameters:
newMinimum - the minimum Options required
Returns:
this builder

withMaximum

public GroupBuilder withMaximum(int newMaximum)
A valid group requires at most this many options present

Parameters:
newMaximum - the maximum Options allowed
Returns:
this builder

withOption

public GroupBuilder withOption(Option option)
Add this option to the group

Parameters:
option - the Option to add
Returns:
this builder

withRequired

public GroupBuilder withRequired(boolean newRequired)
Sets the required flag. This flag is evaluated for groups that are added to other groups as child groups. If set to true the minimum and maximum constraints of the child group are always evaluated.

Parameters:
newRequired - the required flag
Returns:
this builder


Copyright © 2002-2011 Apache Software Foundation. All Rights Reserved.