pbs-middleware-client/src/main/java/cz/muni/ll/middleware/client/jobs/domain/submitRequest/SubmitJobBuilder.java
/**
     * Associates the specified variable value with the specified variable key in variables map.
     * Variables are used for building QSUB command. Optional.
     *
     * @param       variables new variables map to be added to variables map
     * @return      a reference to this object.
     * @exception   IllegalArgumentException in case {@code variables} is {@code null}
     * @exception   IllegalArgumentException in case {@code variables.keySet()} contain {@code null}
     * @exception   IllegalArgumentException in case {@code variables.keySet()} contain blank string
     * @exception   IllegalArgumentException in case {@code variables.values()} contain {@code null}
     * @exception   IllegalArgumentException in case {@code variables.values()} contain blank string
     */
Associates the specified variable value with the specified variable key in variables map.
Variables are used for building QSUB command. Optional.

@param       variables new variables map to be added to variables map
@return      a reference to this object.
Associates the specified variable value with the specified variable key in variables map . Variables are used for building QSUB command . Optional . @param variables new variables map to be added to variables map @return a reference to this object .
public SubmitJobBuilder variables(Map<String, String> variables) {
        if (variables == null) {
            throw new IllegalArgumentException("variables map can not be null");
        }
        if (variables.keySet().stream().anyMatch(Objects::isNull)) {
            throw new IllegalArgumentException("variables map can not contain null key");
        }
        if (variables.keySet().stream().map(key -> key.replace(" ", "")).anyMatch(String::isEmpty)) {
            throw new IllegalArgumentException("variables map can not contain empty as key");
        }
        if (variables.values().stream().anyMatch(Objects::isNull)) {
            throw new IllegalArgumentException("variables map can not contain null value");
        }
        if (variables.values().stream().map(key -> key.replace(" ", "")).anyMatch(String::isEmpty)) {
            throw new IllegalArgumentException("variables map can not contain empty value");
        }
        if (this.variables == null) {
            this.variables = new HashMap<>();
        }
        this.variables.putAll(variables);
        return this;
    }
public SubmitJobBuilder variables ( Map < String , String > variables ) { if ( variables == null ) { throw new IllegalArgumentException ( "variables map can not be null" ) ; } if ( variables . keySet ( ) . stream ( ) . anyMatch ( Objects :: isNull ) ) { throw new IllegalArgumentException ( "variables map can not contain null key" ) ; } if ( variables . keySet ( ) . stream ( ) . map ( key -> key . replace ( " " , "" ) ) . anyMatch ( String :: isEmpty ) ) { throw new IllegalArgumentException ( "variables map can not contain empty as key" ) ; } if ( variables . values ( ) . stream ( ) . anyMatch ( Objects :: isNull ) ) { throw new IllegalArgumentException ( "variables map can not contain null value" ) ; } if ( variables . values ( ) . stream ( ) . map ( key -> key . replace ( " " , "" ) ) . anyMatch ( String :: isEmpty ) ) { throw new IllegalArgumentException ( "variables map can not contain empty value" ) ; } if ( this . variables == null ) { this . variables = new HashMap < > ( ) ; } this . variables . putAll ( variables ) ; return this ; }
Associates the specified variable value with the specified variable key in variables map.
Associates the specified variable value with the specified variable key in variables map .