compbio.metadata
Class Parameter<T>

java.lang.Object
  extended by compbio.metadata.Option<T>
      extended by compbio.metadata.Parameter<T>
All Implemented Interfaces:
Argument<T>

public class Parameter<T>
extends Option<T>

A single value containing an option supported by the web service e.g. seqType=protein. Where seqType is a optionName and protein is one of possibleValues

Version:
1.0 November 2009
Author:
pvtroshin
See Also:
Option, Argument

Constructor Summary
Parameter(String name, String description)
           
 
Method Summary
 Set<String> addOptionNames(String... value)
          Adds an option to the optionName list
 Set<String> addPossibleValues(String... value)
           
 boolean equals(Object obj)
           
 String getOptionName()
           
 List<String> getPossibleValues()
          List is more convenient to work with
 ValueConstrain getValidValue()
           
 int hashCode()
           
 void setDefaultValue(String defaultVal)
          Sets one of the values defined in optionList as default.
 void setOptionName(String optionName)
           
 void setOptionNames(Set<String> optionName)
           
 void setPossibleValues(Set<String> possibleValues)
           
 void setValidValue(ValueConstrain validValue)
           
 String toCommand(String nameValueSeparator)
          Convert the option to the command string.
 String toString()
           
 
Methods inherited from class compbio.metadata.Option
getDefaultValue, getDescription, getFurtherDetails, getName, getOptionNames, isRequired, setDescription, setFurtherDetails, setName, setRequired, setValue
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Parameter

public Parameter(String name,
                 String description)
Method Detail

getValidValue

public ValueConstrain getValidValue()

setValidValue

public void setValidValue(ValueConstrain validValue)

toString

public String toString()
Overrides:
toString in class Option<T>

toCommand

public String toCommand(String nameValueSeparator)
Description copied from class: Option
Convert the option to the command string.

Overrides:
toCommand in class Option<T>
Returns:
If only one optionName is defined, than it is returned, if many option names are defined, then the defaultValue is returned. Option must have a default value if there are many optionNames to be valid.

equals

public boolean equals(Object obj)
Overrides:
equals in class Option<T>

getPossibleValues

public List<String> getPossibleValues()
List is more convenient to work with

Specified by:
getPossibleValues in interface Argument<T>
Overrides:
getPossibleValues in class Option<T>
Returns:
List of String

setPossibleValues

public void setPossibleValues(Set<String> possibleValues)

addPossibleValues

public Set<String> addPossibleValues(String... value)

hashCode

public int hashCode()
Overrides:
hashCode in class Option<T>

setOptionNames

public void setOptionNames(Set<String> optionName)
Overrides:
setOptionNames in class Option<T>

addOptionNames

public Set<String> addOptionNames(String... value)
Description copied from class: Option
Adds an option to the optionName list

Overrides:
addOptionNames in class Option<T>
Returns:
modified optionName list

getOptionName

public String getOptionName()

setOptionName

public void setOptionName(String optionName)

setDefaultValue

public void setDefaultValue(String defaultVal)
                     throws WrongParameterException
Description copied from class: Option
Sets one of the values defined in optionList as default. Attempting set the value not listed there will result in WrongParameter exception

Overrides:
setDefaultValue in class Option<T>
Throws:
WrongParameterException - is thrown if the defaultValue is not found in optionList