agave-jobs/jobs-core/src/test/java/org/iplantc/service/jobs/managers/JobRequestProcessorIT.java
/**
	 * Creates a {@link SoftwareParameter} with teh given constraints, validator, etc.
	 * @param key the key of the parameter
	 * @param type the type of the parameter
	 * @param defaultValue the default value of the parameter
	 * @param validator the validator to use on job requests with this parameter
	 * @param required whether the parameter is required
	 * @param visible whether the parameter should be visible
	 * @return a software parameter with the given constraints
	 */
Creates a  SoftwareParameter with teh given constraints, validator, etc.
Creates a SoftwareParameter with teh given constraints validator etc .
private SoftwareParameter createParameter(String key, String type, Object defaultValue, String validator, boolean required, boolean visible) throws IOException
	{
		SoftwareParameter param = new SoftwareParameter();
		param.setKey(key);
		param.setType(type);
		param.setDefaultValue(defaultValue == null ? null : defaultValue.toString());
		param.setRequired(required);
		param.setVisible(visible);
		if (type.equalsIgnoreCase(SoftwareParameterType.enumeration.name())) {
			assert defaultValue != null;
			String val = ((ArrayNode)defaultValue).get(0).textValue();
			List<SoftwareParameterEnumeratedValue> enums = new ArrayList<SoftwareParameterEnumeratedValue>();
			enums.add(new SoftwareParameterEnumeratedValue(val, val, param));
			enums.add(new SoftwareParameterEnumeratedValue("BETA", "BETA", param));
			enums.add(new SoftwareParameterEnumeratedValue("GAMMA", "GAMMA", param));
			enums.add(new SoftwareParameterEnumeratedValue("DELTA", "DELTA", param));
			param.setEnumValues(enums);
		} else {
			param.setDefaultValue(defaultValue == null ? null : defaultValue.toString());
			param.setValidator(validator);
		}
		return param;
	}
private SoftwareParameter createParameter ( String key , String type , Object defaultValue , String validator , boolean required , boolean visible ) throws IOException { SoftwareParameter param = new SoftwareParameter ( ) ; param . setKey ( key ) ; param . setType ( type ) ; param . setDefaultValue ( defaultValue == null ? null : defaultValue . toString ( ) ) ; param . setRequired ( required ) ; param . setVisible ( visible ) ; if ( type . equalsIgnoreCase ( SoftwareParameterType . enumeration . name ( ) ) ) { assert defaultValue != null ; String val = ( ( ArrayNode ) defaultValue ) . get ( 0 ) . textValue ( ) ; List < SoftwareParameterEnumeratedValue > enums = new ArrayList < SoftwareParameterEnumeratedValue > ( ) ; enums . add ( new SoftwareParameterEnumeratedValue ( val , val , param ) ) ; enums . add ( new SoftwareParameterEnumeratedValue ( "BETA" , "BETA" , param ) ) ; enums . add ( new SoftwareParameterEnumeratedValue ( "GAMMA" , "GAMMA" , param ) ) ; enums . add ( new SoftwareParameterEnumeratedValue ( "DELTA" , "DELTA" , param ) ) ; param . setEnumValues ( enums ) ; } else { param . setDefaultValue ( defaultValue == null ? null : defaultValue . toString ( ) ) ; param . setValidator ( validator ) ; } return param ; }
Creates a {@link SoftwareParameter} with teh given constraints, validator, etc.
Creates a { @link SoftwareParameter } with teh given constraints validator etc .