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

net.wouterdanes.docker.remoteapi.model.ContainerCreateRequest Maven / Gradle / Ivy

package net.wouterdanes.docker.remoteapi.model;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import org.codehaus.jackson.annotate.JsonProperty;

/**
 * See 
 * http://docs.docker.io/reference/api/docker_remote_api_v1.10/#create-a-container
 */
@SuppressWarnings("unused")
public class ContainerCreateRequest {

    @JsonProperty("Hostname")
    private String hostname;
    @JsonProperty("User")
    private String user;
    @JsonProperty("Memory")
    private Long memory;
    @JsonProperty("Cmd")
    private List cmd;
    @JsonProperty("Image")
    private String image;

    public String getHostname() {
        return hostname;
    }

    public String getUser() {
        return user;
    }

    public Long getMemory() {
        return memory;
    }

    public List getCmd() {
        return cmd;
    }

    public String getImage() {
        return image;
    }

    public ContainerCreateRequest withHostname(String hostname) {
        this.hostname = hostname;
        return this;
    }

    public ContainerCreateRequest withUser(String user) {
        this.user = user;
        return this;
    }

    public ContainerCreateRequest withMemory(long memory) {
        this.memory = memory;
        return this;
    }

    public ContainerCreateRequest withCommand(String command) {
        this.cmd = Arrays.asList(command);
        return this;
    }

    public ContainerCreateRequest withCommands(List commands) {
        this.cmd = new ArrayList<>(commands);
        return this;
    }

    public ContainerCreateRequest fromImage(String image) {
        this.image = image;
        return this;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy