/** * @param parameter not null * @param defaultValue could be null * @return an array of files * @throws ScmException if any */ public File[] getFileArray( CommandParameter parameter, File[] defaultValue ) throws ScmException { return (File[]) getObject( File[].class, parameter, defaultValue ); }
/** * @param parameter not null * @return an array of files * @throws ScmException if any */ public File[] getFileArray( CommandParameter parameter ) throws ScmException { return (File[]) getObject( File[].class, parameter ); }
/** * Return the parameter value as String or the default value if it doesn't exist. * * @param parameter The parameter * @param defaultValue The defaultValue * @return The parameter value as a Date * @throws ScmException if the value is in the wrong type */ public Date getDate( CommandParameter parameter, Date defaultValue ) throws ScmException { return (Date) getObject( Date.class, parameter, defaultValue ); }
/** * Return the parameter value as ScmVersion. * * @param parameter The parameter * @return The parameter value as a ScmVersion * @throws ScmException if the parameter doesn't exist */ public ScmVersion getScmVersion( CommandParameter parameter ) throws ScmException { return (ScmVersion) getObject( ScmVersion.class, parameter ); }
/** * Return the parameter value as Date. * * @param parameter The parameter * @return The parameter value as a Date * @throws ScmException if the parameter doesn't exist */ public Date getDate( CommandParameter parameter ) throws ScmException { return (Date) getObject( Date.class, parameter ); }
/** * Return the parameter value as Date. * * @param parameter The parameter * @return The parameter value as a Date * @throws ScmException if the parameter doesn't exist */ public Date getDate( CommandParameter parameter ) throws ScmException { return (Date) getObject( Date.class, parameter ); }
/** * Return the parameter value as ScmVersion. * * @param parameter The parameter * @return The parameter value as a ScmVersion * @throws ScmException if the parameter doesn't exist */ public ScmVersion getScmVersion( CommandParameter parameter ) throws ScmException { return (ScmVersion) getObject( ScmVersion.class, parameter ); }
/** * @param parameter not null * @return an array of files * @throws ScmException if any */ public File[] getFileArray( CommandParameter parameter ) throws ScmException { return (File[]) getObject( File[].class, parameter ); }
/** * @param parameter not null * @param defaultValue could be null * @return an array of files * @throws ScmException if any */ public File[] getFileArray( CommandParameter parameter, File[] defaultValue ) throws ScmException { return (File[]) getObject( File[].class, parameter, defaultValue ); }
/** * Return the parameter value as String or the default value if it doesn't exist. * * @param parameter The parameter * @param defaultValue The defaultValue * @return The parameter value as a Date * @throws ScmException if the value is in the wrong type */ public Date getDate( CommandParameter parameter, Date defaultValue ) throws ScmException { return (Date) getObject( Date.class, parameter, defaultValue ); }
/** * Return the parameter value as ScmVersion or the default value. * * @param parameter The parameter * @param defaultValue The default value * @return The parameter value as a ScmVersion * @throws ScmException if the parameter doesn't exist */ public ScmVersion getScmVersion( CommandParameter parameter, ScmVersion defaultValue ) throws ScmException { return (ScmVersion) getObject( ScmVersion.class, parameter, defaultValue ); }
/** * Return the parameter value as ScmVersion or the default value. * * @param parameter The parameter * @param defaultValue The default value * @return The parameter value as a ScmVersion * @throws ScmException if the parameter doesn't exist */ public ScmVersion getScmVersion( CommandParameter parameter, ScmVersion defaultValue ) throws ScmException { return (ScmVersion) getObject( ScmVersion.class, parameter, defaultValue ); }
/** * Return the parameter value as int. * * @param parameter The parameter * @return The parameter value as a String * @throws ScmException if the parameter doesn't exist */ public int getInt( CommandParameter parameter ) throws ScmException { return ( (Integer) getObject( Integer.class, parameter ) ).intValue(); }
/** * Return the parameter value as int. * * @param parameter The parameter * @return The parameter value as a String * @throws ScmException if the parameter doesn't exist */ public int getInt( CommandParameter parameter ) throws ScmException { return ( (Integer) getObject( Integer.class, parameter ) ).intValue(); }
public ScmBranchParameters getScmBranchParameters( CommandParameter parameter ) throws ScmException { return (ScmBranchParameters) getObject( ScmBranchParameters.class, parameter, new ScmBranchParameters() ); }
public ScmTagParameters getScmTagParameters( CommandParameter parameter ) throws ScmException { return (ScmTagParameters) getObject( ScmTagParameters.class, parameter, new ScmTagParameters() ); }
public ScmBranchParameters getScmBranchParameters( CommandParameter parameter ) throws ScmException { return (ScmBranchParameters) getObject( ScmBranchParameters.class, parameter, new ScmBranchParameters() ); }
public ScmTagParameters getScmTagParameters( CommandParameter parameter ) throws ScmException { return (ScmTagParameters) getObject( ScmTagParameters.class, parameter, new ScmTagParameters() ); }
/** * Return the parameter value as String. * * @param parameter The parameter * @return The parameter value as a String * @throws ScmException if the parameter doesn't exist */ public String getString( CommandParameter parameter ) throws ScmException { Object object = getObject( String.class, parameter ); if ( object == null ) { throw new ScmException( "Missing parameter: '" + parameter.getName() + "'." ); } return object.toString(); }
/** * Set the parameter value. * * @param parameter The parameter * @param value The parameter value * @throws ScmException if the parameter already exist */ private void setObject( CommandParameter parameter, Object value ) throws ScmException { Object object = getObject( null, parameter, null ); if ( object != null ) { throw new ScmException( "The parameter is already set: " + parameter.getName() ); } parameters.put( parameter.getName(), value ); }