pbs-middleware-client/src/main/java/cz/muni/ll/middleware/client/jobs/domain/submitRequest/SubmitJobBuilder.java
/**
     * Add chunk object to the list of chunks.
     *
     * @param       chunk object, which will be added into collection of chunks
     * @return      a reference to this object.
     * @exception   IllegalArgumentException in case {@code chunk} is {@code null}
     * @exception   IllegalArgumentException in case collection of chunks already contain chunk with {@code chunk.getId()}
     */
Add chunk object to the list of chunks.
@param       chunk object, which will be added into collection of chunks
@return      a reference to this object.
@exception   IllegalArgumentException in case  chunk is  null
@exception   IllegalArgumentException in case collection of chunks already contain chunk with  chunk.getId()
Add chunk object to the list of chunks . @param chunk object which will be added into collection of chunks @return a reference to this object . @exception IllegalArgumentException in case chunk is null @exception IllegalArgumentException in case collection of chunks already contain chunk with chunk . getId ()
public SubmitJobBuilder addChunk(Chunk chunk) {
        if (chunk == null) {
            throw new IllegalStateException("Chunk can not be null!");
        }
        if (resources == null) {
            this.resources = new Resources();
        }
        if (this.resources.getChunks() == null) {
            this.resources.setChunks(new LinkedList<>());
        }
        if (this.resources.getChunks().stream().anyMatch(it -> it.getId().equals(chunk.getId()))) {
            throw new IllegalStateException("Chunk with id \"" + chunk.getId() + "\" already exists!");
        }
        this.resources.getChunks().add(chunk);
        return this;
    }
public SubmitJobBuilder addChunk ( Chunk chunk ) { if ( chunk == null ) { throw new IllegalStateException ( "Chunk can not be null!" ) ; } if ( resources == null ) { this . resources = new Resources ( ) ; } if ( this . resources . getChunks ( ) == null ) { this . resources . setChunks ( new LinkedList < > ( ) ) ; } if ( this . resources . getChunks ( ) . stream ( ) . anyMatch ( it -> it . getId ( ) . equals ( chunk . getId ( ) ) ) ) { throw new IllegalStateException ( "Chunk with id \"" + chunk . getId ( ) + "\" already exists!" ) ; } this . resources . getChunks ( ) . add ( chunk ) ; return this ; }
Add chunk object to the list of chunks.
Add chunk object to the list of chunks .