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

com.github.dockerjava.core.command.CreateVolumeCmdImpl Maven / Gradle / Ivy

There is a newer version: 3.4.1
Show newest version
package com.github.dockerjava.core.command;

import static com.google.common.base.Preconditions.checkNotNull;

import java.util.Map;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.github.dockerjava.api.command.CreateVolumeCmd;
import com.github.dockerjava.api.command.CreateVolumeResponse;

/**
 * Create a volume.
 *
 * @author Marcus Linke
 */
public class CreateVolumeCmdImpl extends AbstrDockerCmd implements
        CreateVolumeCmd {

    @JsonProperty("Name")
    private String name;

    @JsonProperty("Driver")
    private String driver;

    @JsonProperty("DriverOpts")
    private Map driverOpts;

    public CreateVolumeCmdImpl(CreateVolumeCmd.Exec exec) {
        super(exec);
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public String getDriver() {
        return driver;
    }

    @Override
    public Map getDriverOpts() {
        return driverOpts;
    }

    @Override
    public CreateVolumeCmdImpl withName(String name) {
        checkNotNull(name, "name was not specified");
        this.name = name;
        return this;
    }

    @Override
    public CreateVolumeCmdImpl withDriver(String driver) {
        checkNotNull(driver, "driver was not specified");
        this.driver = driver;
        return this;
    }

    @Override
    public CreateVolumeCmd withDriverOpts(Map driverOpts) {
        checkNotNull(driverOpts, "driverOpts was not specified");
        this.driverOpts = driverOpts;
        return this;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy