Package org.apache.maven.scm
Class CommandParameters
- java.lang.Object
-
- org.apache.maven.scm.CommandParameters
-
- All Implemented Interfaces:
Serializable
public class CommandParameters extends Object implements Serializable
- Author:
- Trygve Laugstøl, Olivier Lamy
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCommandParameters.SignOptionThe sign option for a commit or tag.
-
Constructor Summary
Constructors Constructor Description CommandParameters()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleangetBoolean(CommandParameter parameter)Return the parameter value as boolean.booleangetBoolean(CommandParameter parameter, boolean defaultValue)Return the parameter value as boolean.DategetDate(CommandParameter parameter)Return the parameter value as Date.DategetDate(CommandParameter parameter, Date defaultValue)Return the parameter value as String or the default value if it doesn't exist.File[]getFileArray(CommandParameter parameter)File[]getFileArray(CommandParameter parameter, File[] defaultValue)intgetInt(CommandParameter parameter)Return the parameter value as int.intgetInt(CommandParameter parameter, int defaultValue)Return the parameter value as int or the default value if it doesn't exist.ScmBranchParametersgetScmBranchParameters(CommandParameter parameter)ScmTagParametersgetScmTagParameters(CommandParameter parameter)ScmVersiongetScmVersion(CommandParameter parameter)Return the parameter value as ScmVersion.ScmVersiongetScmVersion(CommandParameter parameter, ScmVersion defaultValue)Return the parameter value as ScmVersion or the default value.CommandParameters.SignOptiongetSignOption(CommandParameter parameter)Return the sign option.StringgetString(CommandParameter parameter)Return the parameter value as String.StringgetString(CommandParameter parameter, String defaultValue)Return the parameter value or the default value if it doesn't exist.voidremove(CommandParameter parameter)Removes a parameter, silent if it didn't exist.voidsetDate(CommandParameter parameter, Date date)Set a parameter value.voidsetInt(CommandParameter parameter, int value)Set a parameter value.voidsetScmBranchParameters(CommandParameter parameter, ScmBranchParameters scmBranchParameters)voidsetScmTagParameters(CommandParameter parameter, ScmTagParameters scmTagParameters)voidsetScmVersion(CommandParameter parameter, ScmVersion scmVersion)Set a parameter value.voidsetSignOption(CommandParameter parameter, CommandParameters.SignOption signOption)voidsetString(CommandParameter parameter, String value)Set a parameter value.
-
-
-
Constructor Detail
-
CommandParameters
public CommandParameters()
-
-
Method Detail
-
getString
public 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 String getString(CommandParameter parameter, String defaultValue) throws ScmException
Return the parameter value or the default value if it doesn't exist.- Parameters:
parameter- the parameterdefaultValue- 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, String value) throws ScmException
Set a parameter value.- Parameters:
parameter- the parameter namevalue- 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 parameterdefaultValue- the default value- Returns:
- the parameter value as an 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 namevalue- the value of the parameter- Throws:
ScmException- if the parameter already exist
-
getDate
public 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 Date getDate(CommandParameter parameter, Date defaultValue) throws ScmException
Return the parameter value as String or the default value if it doesn't exist.- Parameters:
parameter- the parameterdefaultValue- 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, Date date) throws ScmException
Set a parameter value.- Parameters:
parameter- the parameter namedate- 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 parameterdefaultValue- default value if parameter not exists- Returns:
- the parameter value as a boolean
- Throws:
ScmException- if the parameter doesn't exist- 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 parameterdefaultValue- 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 namescmVersion- the tbranch/tag/revision- Throws:
ScmException- if the parameter already exist
-
getFileArray
public File[] getFileArray(CommandParameter parameter) throws ScmException
- Parameters:
parameter- not null- Returns:
- an array of files
- Throws:
ScmException- if any
-
getFileArray
public File[] getFileArray(CommandParameter parameter, File[] defaultValue) throws ScmException
- Parameters:
parameter- not nulldefaultValue- 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
-
setSignOption
public void setSignOption(CommandParameter parameter, CommandParameters.SignOption signOption) throws ScmException
- Throws:
ScmException
-
getSignOption
public CommandParameters.SignOption getSignOption(CommandParameter parameter) throws ScmException
Return the sign option.- Parameters:
parameter- the parameter- Returns:
- the sign option or null if not set
- Throws:
ScmException- if the parameter has the wrong type
-
remove
public void remove(CommandParameter parameter)
Removes a parameter, silent if it didn't exist.- Parameters:
parameter- to remove
-
-