Class CommandParameters

java.lang.Object
org.apache.maven.scm.CommandParameters
All Implemented Interfaces:
Serializable

public class CommandParameters extends Object implements Serializable
See Also:
  • Field Details

  • Constructor Details

    • CommandParameters

      public CommandParameters()
  • Method Details

    • 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 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, 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 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 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, 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 - 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 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 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 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
    • getObject

      private Object getObject(Class<?> clazz, CommandParameter parameter) throws ScmException
      Return the value object.
      Parameters:
      clazz - The type of the parameter value
      parameter - The parameter
      Returns:
      The parameter value
      Throws:
      ScmException - if the parameter doesn't exist
    • getObject

      private Object getObject(Class<?> clazz, CommandParameter parameter, Object defaultValue) throws ScmException
      Return the value object or the default value if it doesn't exist.
      Parameters:
      clazz - The type of the parameter value
      parameter - The parameter
      defaultValue - The defaultValue
      Returns:
      The parameter value
      Throws:
      ScmException - if the defaultValue is in the wrong type
    • setObject

      private void setObject(CommandParameter parameter, Object value) throws ScmException
      Set the parameter value.
      Parameters:
      parameter - The parameter
      value - The parameter value
      Throws:
      ScmException - if the parameter already exist
    • remove

      public void remove(CommandParameter parameter)
      Removes a parameter, silent if it didn't exist.
      Parameters:
      parameter - to remove