org.apache.commons.betwixt
Class Options

java.lang.Object
  extended by org.apache.commons.betwixt.Options

public class Options
extends java.lang.Object

Collective for Betwixt optional behaviour hints. An option links a name with a value (both strings).

Since:
0.5
Author:
Apache Commons Team

Constructor Summary
Options()
           
 
Method Summary
 void addOption(java.lang.String name, java.lang.String value)
          Adds the option.
 void addOptions(Options options)
          Adds multiple options from an existing Options collection.
 java.lang.String[] getNames()
          Gets the names of each option.
 java.lang.String getValue(java.lang.String name)
          Gets the value (if any) associated with the given name.
 
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

getValue

public java.lang.String getValue(java.lang.String name)
Gets the value (if any) associated with the given name.

Parameters:
name - String, not null
Returns:
the associated value, or null if no value is assocated

getNames

public java.lang.String[] getNames()
Gets the names of each option.

Returns:
String array containing the name of each option

addOption

public void addOption(java.lang.String name,
                      java.lang.String value)
Adds the option. The rule with options is that the last call to set the value with a given name wins.

Parameters:
name - String name, not null
value - Strong name, not null

addOptions

public void addOptions(Options options)
Adds multiple options from an existing Options collection. The rule with options is that the most recently set value for an option wins, so options are potentially overwritten by this call.

Parameters:
options - - an existing Options collection
Since:
0.8


Copyright © 2002-2008 The Apache Software Foundation. All Rights Reserved.