package com.github.dockerjava.api.model;

import java.util.Map;

import org.apache.commons.lang.builder.ToStringBuilder;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
 *
 * @author Konstantin Pelykh (kpelykh@gmail.com)
 *
 */
@JsonIgnoreProperties(ignoreUnknown = true)
public class ContainerConfig {

    @JsonProperty("AttachStderr")
    private boolean attachStderr = false;

    @JsonProperty("AttachStdin")
    private boolean attachStdin = false;

    @JsonProperty("AttachStdout")
    private boolean attachStdout = false;

    @JsonProperty("Cmd")
    private String[] cmd;

    @JsonProperty("CpuShares")
    private int cpuShares = 0;

    @JsonProperty("Cpuset")
    private String cpuset = "";

    @JsonProperty("Domainname")
    private String domainName = "";

    @JsonProperty("Entrypoint")
    private String[] entrypoint = new String[] {};

    @JsonProperty("Env")
    private String[] env;

    @JsonProperty("ExposedPorts")
    private ExposedPorts exposedPorts;

    @JsonProperty("Hostname")
    private String hostName = "";

    @JsonProperty("Image")
    private String image;

    @JsonProperty("Labels")
    private Map<String, String> labels;

    @JsonProperty("MacAddress")
    private String macAddress;

    @JsonProperty("Memory")
    private long memoryLimit = 0;

    @JsonProperty("MemorySwap")
    private long memorySwap = 0;

    @JsonProperty("NetworkDisabled")
    private boolean networkDisabled = false;

    @JsonProperty("OnBuild")
    private String[] onBuild;

    @JsonProperty("OpenStdin")
    private boolean stdinOpen = false;

    @JsonProperty("PortSpecs")
    private String[] portSpecs;

    @JsonProperty("StdinOnce")
    private boolean stdInOnce = false;

    @JsonProperty("Tty")
    private boolean tty = false;

    @JsonProperty("User")
    private String user = "";

    @JsonProperty("Volumes")
    private Map<String, ?> volumes;

    @JsonProperty("WorkingDir")
    private String workingDir = "";

    @JsonIgnore
    public ExposedPort[] getExposedPorts() {
        return exposedPorts.getExposedPorts();
    }

    public boolean isNetworkDisabled() {
        return networkDisabled;
    }

    public String getDomainName() {
        return domainName;
    }

    public String getWorkingDir() {
        return workingDir;
    }

    public String getHostName() {
        return hostName;
    }

    public String[] getPortSpecs() {
        return portSpecs;
    }

    public String getUser() {
        return user;
    }

    public boolean isTty() {
        return tty;
    }

    public boolean isStdinOpen() {
        return stdinOpen;
    }

    public boolean isStdInOnce() {
        return stdInOnce;
    }

    public String getMacAddress() {
        return macAddress;
    }

    public long getMemoryLimit() {
        return memoryLimit;
    }

    public long getMemorySwap() {
        return memorySwap;
    }

    public int getCpuShares() {
        return cpuShares;
    }

    public String getCpuset() {
        return cpuset;
    }

    public boolean isAttachStdin() {
        return attachStdin;
    }

    public boolean isAttachStdout() {
        return attachStdout;
    }

    public boolean isAttachStderr() {
        return attachStderr;
    }

    public String[] getEnv() {
        return env;
    }

    public String[] getCmd() {
        return cmd;
    }

    public String getImage() {
        return image;
    }

    public Map<String, ?> getVolumes() {
        return volumes;
    }

    public String[] getEntrypoint() {
        return entrypoint;
    }

    public String[] getOnBuild() {
        return onBuild;
    }

    public Map<String, String> getLabels() {
        return labels;
    }

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }
}

@@ -708,132 +708,8 @@
 d;%0A%0A
-    @JsonProperty(%22CpuShares%22)%0A    private int cpuShares = 0;%0A%0A    @JsonProperty(%22Cpuset%22)%0A    private String cpuset = %22%22;%0A%0A
     
@@ -1239,137 +1239,8 @@
 s;%0A%0A
-    @JsonProperty(%22Memory%22)%0A    private long memoryLimit = 0;%0A%0A    @JsonProperty(%22MemorySwap%22)%0A    private long memorySwap = 0;%0A%0A
     
@@ -2630,273 +2630,8 @@
  %7D%0A%0A
-    public long getMemoryLimit() %7B%0A        return memoryLimit;%0A    %7D%0A%0A    public long getMemorySwap() %7B%0A        return memorySwap;%0A    %7D%0A%0A    public int getCpuShares() %7B%0A        return cpuShares;%0A    %7D%0A%0A    public String getCpuset() %7B%0A        return cpuset;%0A    %7D%0A%0A
     

Remove Memory, MemorySwap and CpuShares mappings from ContainerConfig