Class CommandParameters

    • 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 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
        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
      • remove

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