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

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