public class

Options

extends Object
java.lang.Object
   ↳ org.apache.commons.betwixt.Options

Class Overview

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

Summary

Public Constructors
Options()
Public Methods
void addOption(String name, String value)
Adds the option.
void addOptions(Options options)
Adds multiple options from an existing Options collection.
String[] getNames()
Gets the names of each option.
String getValue(String name)
Gets the value (if any) associated with the given name.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Options ()

Public Methods

public void addOption (String name, 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

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

public String[] getNames ()

Gets the names of each option.

Returns
  • String array containing the name of each option

public String getValue (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