/** * Returns the single input parameter with the given identifier (convenience method for the common case when only a * single parameter with a certain identifier is allowed). * * @param parameterId * identifier of the input parameters to be looked up * @return the input parameters with the given identifier, or null if no such parameter exists * @throws RuntimeException * when more than one input parameter with the specified identifier is present */ public ProcessletInput getParameter( CodeType parameterId ) { List<ProcessletInput> inputs = getParameters( parameterId ); if ( inputs == null || inputs.size() == 0 ) { return null; } if ( inputs.size() > 1 ) { String msg = "Unexpected input. More than one input parameter with identifier '" + parameterId + "'."; throw new RuntimeException( msg ); } return inputs.get( 0 ); }
/** * Returns the single input parameter with the given identifier (convenience method for the common case when only a * single parameter with a certain identifier is allowed and the identifier has a <code>null</code> codeSpace). * * @param parameterId * identifier of the input parameters to be looked up * @return the input parameters with the given identifier, or null if no such parameter exists * @throws RuntimeException * when more than one input parameter with the specified identifier is present */ public ProcessletInput getParameter( String parameterId ) { List<ProcessletInput> inputs = getParameters( new CodeType( parameterId ) ); if ( inputs == null || inputs.size() == 0 ) { return null; } if ( inputs.size() > 1 ) { String msg = "Unexpected input. More than one input parameter with identifier '" + parameterId + "'."; throw new RuntimeException( msg ); } return inputs.get( 0 ); }
/** * Returns the single input parameter with the given identifier (convenience method for the common case when only a * single parameter with a certain identifier is allowed). * * @param parameterId * identifier of the input parameters to be looked up * @param codeSpace * codeSpace of the parameter identifier * @return the input parameters with the given identifier, or null if no such parameter exists * @throws RuntimeException * when more than one input parameter with the specified identifier is present */ public ProcessletInput getParameter( String parameterId, String codeSpace ) { CodeType code = new CodeType( parameterId, codeSpace ); List<ProcessletInput> inputs = getParameters( code ); if ( inputs == null || inputs.size() == 0 ) { return null; } if ( inputs.size() > 1 ) { String msg = "Unexpected input. More than one input parameter with identifier '" + code + "'."; throw new RuntimeException( msg ); } return inputs.get( 0 ); } }
for ( ProcessletInput input : response.getDataInputs().getParameters() ) {