package com.kpelykh.docker.client.model;

import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.codehaus.jackson.annotate.JsonProperty;

import java.util.Arrays;

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

    @JsonProperty("Id")
    private String id;

    @JsonProperty("Command")
    private String command;

    @JsonProperty("Image")
    private String image;

    @JsonProperty("Created")
    private long created;

    @JsonProperty("Status")
    private String status;

    /* Example:
    "Ports": {
        "22/tcp": [
            {
                "HostIp": "0.0.0.0",
                "HostPort": "8022"
            }
        ]
    }
    */

    @JsonProperty("Ports")    
    public Ports ports;

    @JsonProperty("SizeRw")
    private int size;

    @JsonProperty("SizeRootFs")
    private int sizeRootFs;

    public String getId() {
        return id;
    }

    public String getCommand() {
        return command;
    }

    public String getImage() {
        return image;
    }

    public long getCreated() {
        return created;
    }

    public String getStatus() {
        return status;
    }

    public Ports getPorts() {
        return ports;
    }

    public void setPorts(Ports ports) {
        this.ports = ports;
    }

    public int getSize() {
        return size;
    }

    public int getSizeRootFs() {
        return sizeRootFs;
    }

    @Override
    public String toString() {
        return "Container{" +
                "id='" + id + '\'' +
                ", command='" + command + '\'' +
                ", image='" + image + '\'' +
                ", created=" + created +
                ", status='" + status + '\'' +
                ", ports=" + ports +
                ", size=" + size +
                ", sizeRootFs=" + sizeRootFs +
                '}';
    }
}

@@ -964,24 +964,83 @@
 eRootFs;%0D%0A%0D%0A
+    @JsonProperty(%22Names%22)%0D%0A    private String%5B%5D names;%0D%0A%0D%0A
     public S
@@ -1052,24 +1052,24 @@
  getId() %7B%0D%0A
-
         retu
@@ -1617,24 +1617,90 @@
 ;%0D%0A    %7D%0D%0A%0D%0A
+    public String%5B%5D getNames() %7B%0D%0A        return names;%0D%0A    %7D%0D%0A%0D%0A
     @Overrid
@@ -2059,24 +2059,24 @@
 %22 + size +%0D%0A
-
             
@@ -2107,24 +2107,79 @@
 zeRootFs +%0D%0A
+                %22, names=%22 + Arrays.toString(names) +%0D%0A
             

Allow to get names from container