All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.atlassian.bamboo.specs.builders.task.AbstractDockerTask Maven / Gradle / Ivy

There is a newer version: 10.1.0
Show newest version
package com.atlassian.bamboo.specs.builders.task;

import com.atlassian.bamboo.specs.api.builders.task.Task;
import com.atlassian.bamboo.specs.model.task.docker.AbstractDockerTaskProperties;
import org.jetbrains.annotations.Nullable;

import java.util.Objects;


/**
 * Generic Docker task.
 */
public abstract class AbstractDockerTask, P extends AbstractDockerTaskProperties> extends Task {
    @Nullable
    protected String environmentVariables;
    @Nullable
    protected String workingSubdirectory;

    /**
     * Environment variables which will be passed to Docker process.
     */
    public T environmentVariables(String environmentVariables) {
        this.environmentVariables = environmentVariables;
        return (T) this;
    }

    /**
     * An alternative subdirectory as working directory for this task.
     */
    public T workingSubdirectory(String workingSubdirectory) {
        this.workingSubdirectory = workingSubdirectory;
        return (T) this;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof AbstractDockerTask)) {
            return false;
        }
        if (!super.equals(o)) {
            return false;
        }
        AbstractDockerTask that = (AbstractDockerTask) o;
        return Objects.equals(environmentVariables, that.environmentVariables) &&
                Objects.equals(workingSubdirectory, that.workingSubdirectory);
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), environmentVariables, workingSubdirectory);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy