Package org.apache.maven.scm

## Class CommandParameters

- java.lang.Object
- - org.apache.maven.scm.CommandParameters

All Implemented Interfaces:
  `java.io.Serializable`

    public class CommandParameters
    extends java.lang.Object
    implements java.io.Serializable

Author:
  Trygve Laugstøl, Olivier Lamy
See Also:
  Serialized Form

### Constructor Summary

Constructors
`CommandParameters()`

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `getBoolean​(CommandParameter parameter)` Return the parameter value as boolean.
`boolean` `getBoolean​(CommandParameter parameter, boolean defaultValue)` Return the parameter value as boolean.
`java.util.Date` `getDate​(CommandParameter parameter)` Return the parameter value as Date.
`java.util.Date` `getDate​(CommandParameter parameter, java.util.Date defaultValue)` Return the parameter value as String or the default value if it doesn't exist.
`java.io.File[]` `getFileArray​(CommandParameter parameter)`
`java.io.File[]` `getFileArray​(CommandParameter parameter, java.io.File[] defaultValue)`
`int` `getInt​(CommandParameter parameter)` Return the parameter value as int.
`int` `getInt​(CommandParameter parameter, int defaultValue)` Return the parameter value as int or the default value if it doesn't exist.
`ScmBranchParameters` `getScmBranchParameters​(CommandParameter parameter)`
`ScmTagParameters` `getScmTagParameters​(CommandParameter parameter)`
`ScmVersion` `getScmVersion​(CommandParameter parameter)` Return the parameter value as ScmVersion.
`ScmVersion` `getScmVersion​(CommandParameter parameter, ScmVersion defaultValue)` Return the parameter value as ScmVersion or the default value.
`java.lang.String` `getString​(CommandParameter parameter)` Return the parameter value as String.
`java.lang.String` `getString​(CommandParameter parameter, java.lang.String defaultValue)` Return the parameter value or the default value if it doesn't exist.
`void` `remove​(CommandParameter parameter)` Removes a parameter, silent if it didn't exist.
`void` `setDate​(CommandParameter parameter, java.util.Date date)` Set a parameter value.
`void` `setInt​(CommandParameter parameter, int value)` Set a parameter value.
`void` `setScmBranchParameters​(CommandParameter parameter, ScmBranchParameters scmBranchParameters)`
`void` `setScmTagParameters​(CommandParameter parameter, ScmTagParameters scmTagParameters)`
`void` `setScmVersion​(CommandParameter parameter, ScmVersion scmVersion)` Set a parameter value.
`void` `setString​(CommandParameter parameter, java.lang.String value)` Set a parameter value.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### CommandParameters

    public CommandParameters()

### Method Detail

#### getString

    public java.lang.String getString​(CommandParameter parameter)
                               throws ScmException

Return the parameter value as String.

Parameters:
  `parameter` - The parameter
Returns:
  The parameter value as a String
Throws:
  `ScmException` - if the parameter doesn't exist

#### getString

    public java.lang.String getString​(CommandParameter parameter,
                                      java.lang.String defaultValue)
                               throws ScmException

Return the parameter value or the default value if it doesn't exist.

Parameters:
  `parameter` - The parameter
  `defaultValue` - The default value
Returns:
  The parameter value as a String
Throws:
  `ScmException` - if the value is in the wrong type

#### setString

    public void setString​(CommandParameter parameter,
                          java.lang.String value)
                   throws ScmException

Set a parameter value.

Parameters:
  `parameter` - The parameter name
  `value` - The value of the parameter
Throws:
  `ScmException` - if the parameter already exist

#### getInt

    public int getInt​(CommandParameter parameter)
               throws ScmException

Return the parameter value as int.

Parameters:
  `parameter` - The parameter
Returns:
  The parameter value as a String
Throws:
  `ScmException` - if the parameter doesn't exist

#### getInt

    public int getInt​(CommandParameter parameter,
                      int defaultValue)
               throws ScmException

Return the parameter value as int or the default value if it doesn't exist.

Parameters:
  `parameter` - The parameter
  `defaultValue` - The defaultValue
Returns:
  The parameter value as a int
Throws:
  `ScmException` - if the value is in the wrong type

#### setInt

    public void setInt​(CommandParameter parameter,
                       int value)
                throws ScmException

Set a parameter value.

Parameters:
  `parameter` - The parameter name
  `value` - The value of the parameter
Throws:
  `ScmException` - if the parameter already exist

#### getDate

    public java.util.Date getDate​(CommandParameter parameter)
                           throws ScmException

Return the parameter value as Date.

Parameters:
  `parameter` - The parameter
Returns:
  The parameter value as a Date
Throws:
  `ScmException` - if the parameter doesn't exist

#### getDate

    public java.util.Date getDate​(CommandParameter parameter,
                                  java.util.Date defaultValue)
                           throws ScmException

Return the parameter value as String or the default value if it doesn't exist.

Parameters:
  `parameter` - The parameter
  `defaultValue` - The defaultValue
Returns:
  The parameter value as a Date
Throws:
  `ScmException` - if the value is in the wrong type

#### setDate

    public void setDate​(CommandParameter parameter,
                        java.util.Date date)
                 throws ScmException

Set a parameter value.

Parameters:
  `parameter` - The parameter name
  `date` - The value of the parameter
Throws:
  `ScmException` - if the parameter already exist

#### getBoolean

    public boolean getBoolean​(CommandParameter parameter)
                       throws ScmException

Return the parameter value as boolean.

Parameters:
  `parameter` - The parameter
Returns:
  The parameter value as a boolean
Throws:
  `ScmException` - if the parameter doesn't exist

#### getBoolean

    public boolean getBoolean​(CommandParameter parameter,
                              boolean defaultValue)
                       throws ScmException

Return the parameter value as boolean.

Parameters:
  `parameter` - The parameter
  `defaultValue` - default value if parameter not exists
Returns:
  The parameter value as a boolean
Throws:
  `ScmException`
Since:
  1.7

#### getScmVersion

    public ScmVersion getScmVersion​(CommandParameter parameter)
                             throws ScmException

Return the parameter value as ScmVersion.

Parameters:
  `parameter` - The parameter
Returns:
  The parameter value as a ScmVersion
Throws:
  `ScmException` - if the parameter doesn't exist

#### getScmVersion

    public ScmVersion getScmVersion​(CommandParameter parameter,
                                    ScmVersion defaultValue)
                             throws ScmException

Return the parameter value as ScmVersion or the default value.

Parameters:
  `parameter` - The parameter
  `defaultValue` - The default value
Returns:
  The parameter value as a ScmVersion
Throws:
  `ScmException` - if the parameter doesn't exist

#### setScmVersion

    public void setScmVersion​(CommandParameter parameter,
                              ScmVersion scmVersion)
                       throws ScmException

Set a parameter value.

Parameters:
  `parameter` - The parameter name
  `scmVersion` - The tbranch/tag/revision
Throws:
  `ScmException` - if the parameter already exist

#### getFileArray

    public java.io.File[] getFileArray​(CommandParameter parameter)
                                throws ScmException

Parameters:
  `parameter` - not null
Returns:
  an array of files
Throws:
  `ScmException` - if any

#### getFileArray

    public java.io.File[] getFileArray​(CommandParameter parameter,
                                       java.io.File[] defaultValue)
                                throws ScmException

Parameters:
  `parameter` - not null
  `defaultValue` - could be null
Returns:
  an array of files
Throws:
  `ScmException` - if any

#### getScmTagParameters

    public ScmTagParameters getScmTagParameters​(CommandParameter parameter)
                                         throws ScmException

Throws:
  `ScmException`

#### setScmTagParameters

    public void setScmTagParameters​(CommandParameter parameter,
                                    ScmTagParameters scmTagParameters)
                             throws ScmException

Throws:
  `ScmException`

#### setScmBranchParameters

    public void setScmBranchParameters​(CommandParameter parameter,
                                       ScmBranchParameters scmBranchParameters)
                                throws ScmException

Throws:
  `ScmException`

#### getScmBranchParameters

    public ScmBranchParameters getScmBranchParameters​(CommandParameter parameter)
                                               throws ScmException

Throws:
  `ScmException`

#### remove

    public void remove​(CommandParameter parameter)

Removes a parameter, silent if it didn't exist.

Parameters:
  `parameter` - to remove