phonebill.util
Class Parameters.Value

java.lang.Object
  |
  +--phonebill.util.Parameters.Value
Enclosing class:
Parameters

public class Parameters.Value
extends java.lang.Object

This inner class encapsulates the properties and value of a command line parameter. Names of parameters are not supposed to contain dashes or any other form of parameter prefix. A null value represents parameters with only properties defined.


Field Summary
 java.lang.String longName
          The long name for this parameter.
 java.lang.String shortName
          The short name for this parameter.
 int type
          The type of parameter.
protected  java.lang.Object value
          The value for this parameter.
 
Constructor Summary
private Parameters.Value()
          Fake constructor not intended for use, only for blocking use.
  Parameters.Value(java.lang.String name, int type)
          Constructs a Value object containing most of the properties of a parameter.
  Parameters.Value(java.lang.String shortName, java.lang.String longName, int type)
          Constructs a Value object containing all the necessary properties of a parameter.
  Parameters.Value(java.lang.String shortName, java.lang.String longName, int type, java.lang.Object value)
          Constructs a Value object containing all the necessary properties and values of a parameter.
 
Method Summary
 java.lang.Object getValue()
          Returns the current value for the parameter.
 boolean setValue(java.lang.Object value)
          Sets the parameter value.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

shortName

public final java.lang.String shortName
The short name for this parameter.

longName

public final java.lang.String longName
The long name for this parameter.

type

public final int type
The type of parameter.

value

protected java.lang.Object value
The value for this parameter.
Constructor Detail

Parameters.Value

private Parameters.Value()
Fake constructor not intended for use, only for blocking use.

Parameters.Value

public Parameters.Value(java.lang.String name,
                        int type)
Constructs a Value object containing most of the properties of a parameter.
Parameters:
name - the short name for this parameter.
type - the type of parameter

Parameters.Value

public Parameters.Value(java.lang.String shortName,
                        java.lang.String longName,
                        int type)
Constructs a Value object containing all the necessary properties of a parameter.
Parameters:
shortName - the short name for this parameter.
longName - the long name for this parameter.
type - the type of parameter

Parameters.Value

public Parameters.Value(java.lang.String shortName,
                        java.lang.String longName,
                        int type,
                        java.lang.Object value)
Constructs a Value object containing all the necessary properties and values of a parameter. value must conform to the setValue() method.
Parameters:
shortName - the short name for this parameter.
longName - the long name for this parameter.
type - the type of parameter
value - the value for this parameter
Method Detail

setValue

public boolean setValue(java.lang.Object value)
Sets the parameter value.
Parameters:
value - The new value of this parameter. Only instances of String, Number, Boolean, Date or File are accepted as well as null.

getValue

public java.lang.Object getValue()
Returns the current value for the parameter.