Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
   /*
    * Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
    * 
    * Licensed under the Apache License, Version 2.0 (the "License").
    * You may not use this file except in compliance with the License.
    * A copy of the License is located at
    * 
    *  http://aws.amazon.com/apache2.0
    * 
   * or in the "license" file accompanying this file. This file is distributed
   * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
   * express or implied. See the License for the specific language governing
   * permissions and limitations under the License.
   */
  package com.amazonaws.services.ecs.model;
  

Container definitions are used in task definitions to describe the different containers that are launched as part of a task.

  
  public class ContainerDefinition implements SerializableCloneable {

    
The name of a container. If you are linking multiple containers together in a task definition, the name of one container can be entered in the links of another container to connect the containers.
  
      private String name;

    
The image used to start a container. This string is passed directly to the Docker daemon. Images in the Docker Hub registry are available by default. Other repositories are specified with repository-url/image:tag.
  
      private String image;

    
The number of cpu units reserved for the container. A container instance has 1,024 cpu units for every CPU core.
  
      private Integer cpu;

    
The number of MiB of memory reserved for the container. Docker will allocate a minimum of 4 MiB of memory to a container.
  
      private Integer memory;

    
The link parameter allows containers to communicate with each other without the need for port mappings, using the name parameter. For more information on linking Docker containers, see https://docs.docker.com/userguide/dockerlinks/.
  
The list of port mappings for the container.
  
If the essential parameter of a container is marked as true, the failure of that container will stop the task. If the essential parameter of a container is marked as false, then its failure will not affect the rest of the containers in a task.
  
      private Boolean essential;

    
<important>

Early versions of the Amazon ECS container agent do not properly handle entryPoint parameters. If you have problems using entryPoint, update your container agent or enter your commands and arguments as command array items instead. </important>

The ENTRYPOINT that is passed to the container. For more information on the Docker ENTRYPOINT parameter, see https://docs.docker.com/reference/builder/#entrypoint.

  
The CMD that is passed to the container. For more information on the Docker CMD parameter, see https://docs.docker.com/reference/builder/#cmd.
  
The environment variables to pass to a container.
 
The mount points for data volumes in your container.
 
Data volumes to mount from another container.
 
The name of a container. If you are linking multiple containers together in a task definition, the name of one container can be entered in the links of another container to connect the containers.

Returns:
The name of a container. If you are linking multiple containers together in a task definition, the name of one container can be entered in the links of another container to connect the containers.
 
     public String getName() {
         return ;
     }
    
    
The name of a container. If you are linking multiple containers together in a task definition, the name of one container can be entered in the links of another container to connect the containers.

Parameters:
name The name of a container. If you are linking multiple containers together in a task definition, the name of one container can be entered in the links of another container to connect the containers.
 
     public void setName(String name) {
         this. = name;
     }
    
    
The name of a container. If you are linking multiple containers together in a task definition, the name of one container can be entered in the links of another container to connect the containers.

Returns a reference to this object so that method calls can be chained together.

Parameters:
name The name of a container. If you are linking multiple containers together in a task definition, the name of one container can be entered in the links of another container to connect the containers.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public ContainerDefinition withName(String name) {
         this. = name;
         return this;
     }

    
The image used to start a container. This string is passed directly to the Docker daemon. Images in the Docker Hub registry are available by default. Other repositories are specified with repository-url/image:tag.

Returns:
The image used to start a container. This string is passed directly to the Docker daemon. Images in the Docker Hub registry are available by default. Other repositories are specified with repository-url/image:tag.
 
     public String getImage() {
         return ;
     }
    
    
The image used to start a container. This string is passed directly to the Docker daemon. Images in the Docker Hub registry are available by default. Other repositories are specified with repository-url/image:tag.

Parameters:
image The image used to start a container. This string is passed directly to the Docker daemon. Images in the Docker Hub registry are available by default. Other repositories are specified with repository-url/image:tag.
 
     public void setImage(String image) {
         this. = image;
     }
    
    
The image used to start a container. This string is passed directly to the Docker daemon. Images in the Docker Hub registry are available by default. Other repositories are specified with repository-url/image:tag.

Returns a reference to this object so that method calls can be chained together.

Parameters:
image The image used to start a container. This string is passed directly to the Docker daemon. Images in the Docker Hub registry are available by default. Other repositories are specified with repository-url/image:tag.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public ContainerDefinition withImage(String image) {
         this. = image;
         return this;
     }

    
The number of cpu units reserved for the container. A container instance has 1,024 cpu units for every CPU core.

Returns:
The number of cpu units reserved for the container. A container instance has 1,024 cpu units for every CPU core.
 
     public Integer getCpu() {
         return ;
     }
    
    
The number of cpu units reserved for the container. A container instance has 1,024 cpu units for every CPU core.

Parameters:
cpu The number of cpu units reserved for the container. A container instance has 1,024 cpu units for every CPU core.
 
     public void setCpu(Integer cpu) {
         this. = cpu;
     }
    
    
The number of cpu units reserved for the container. A container instance has 1,024 cpu units for every CPU core.

Returns a reference to this object so that method calls can be chained together.

Parameters:
cpu The number of cpu units reserved for the container. A container instance has 1,024 cpu units for every CPU core.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public ContainerDefinition withCpu(Integer cpu) {
         this. = cpu;
         return this;
     }

    
The number of MiB of memory reserved for the container. Docker will allocate a minimum of 4 MiB of memory to a container.

Returns:
The number of MiB of memory reserved for the container. Docker will allocate a minimum of 4 MiB of memory to a container.
 
     public Integer getMemory() {
         return ;
     }
    
    
The number of MiB of memory reserved for the container. Docker will allocate a minimum of 4 MiB of memory to a container.

Parameters:
memory The number of MiB of memory reserved for the container. Docker will allocate a minimum of 4 MiB of memory to a container.
 
     public void setMemory(Integer memory) {
         this. = memory;
     }
    
    
The number of MiB of memory reserved for the container. Docker will allocate a minimum of 4 MiB of memory to a container.

Returns a reference to this object so that method calls can be chained together.

Parameters:
memory The number of MiB of memory reserved for the container. Docker will allocate a minimum of 4 MiB of memory to a container.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public ContainerDefinition withMemory(Integer memory) {
         this. = memory;
         return this;
     }

    
The link parameter allows containers to communicate with each other without the need for port mappings, using the name parameter. For more information on linking Docker containers, see https://docs.docker.com/userguide/dockerlinks/.

Returns:
The link parameter allows containers to communicate with each other without the need for port mappings, using the name parameter. For more information on linking Docker containers, see https://docs.docker.com/userguide/dockerlinks/.
 
     public java.util.List<StringgetLinks() {
         if ( == null) {
                = new com.amazonaws.internal.ListWithAutoConstructFlag<String>();
               .setAutoConstruct(true);
         }
         return ;
     }
    
    
The link parameter allows containers to communicate with each other without the need for port mappings, using the name parameter. For more information on linking Docker containers, see https://docs.docker.com/userguide/dockerlinks/.

Parameters:
links The link parameter allows containers to communicate with each other without the need for port mappings, using the name parameter. For more information on linking Docker containers, see https://docs.docker.com/userguide/dockerlinks/.
 
     public void setLinks(java.util.Collection<Stringlinks) {
         if (links == null) {
             this. = null;
             return;
         }
         linksCopy.addAll(links);
         this. = linksCopy;
     }
    
    
The link parameter allows containers to communicate with each other without the need for port mappings, using the name parameter. For more information on linking Docker containers, see https://docs.docker.com/userguide/dockerlinks/.

NOTE: This method appends the values to the existing list (if any). Use setLinks(java.util.Collection) or withLinks(java.util.Collection) if you want to override the existing values.

Returns a reference to this object so that method calls can be chained together.

Parameters:
links The link parameter allows containers to communicate with each other without the need for port mappings, using the name parameter. For more information on linking Docker containers, see https://docs.docker.com/userguide/dockerlinks/.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public ContainerDefinition withLinks(String... links) {
         if (getLinks() == nullsetLinks(new java.util.ArrayList<String>(links.length));
         for (String value : links) {
             getLinks().add(value);
         }
         return this;
     }
    
    
The link parameter allows containers to communicate with each other without the need for port mappings, using the name parameter. For more information on linking Docker containers, see https://docs.docker.com/userguide/dockerlinks/.

Returns a reference to this object so that method calls can be chained together.

Parameters:
links The link parameter allows containers to communicate with each other without the need for port mappings, using the name parameter. For more information on linking Docker containers, see https://docs.docker.com/userguide/dockerlinks/.
Returns:
A reference to this updated object so that method calls can be chained together.
 
         if (links == null) {
             this. = null;
         } else {
             linksCopy.addAll(links);
             this. = linksCopy;
         }
 
         return this;
     }

    
The list of port mappings for the container.

Returns:
The list of port mappings for the container.
 
     public java.util.List<PortMappinggetPortMappings() {
         if ( == null) {
                = new com.amazonaws.internal.ListWithAutoConstructFlag<PortMapping>();
               .setAutoConstruct(true);
         }
         return ;
     }
    
    
The list of port mappings for the container.

Parameters:
portMappings The list of port mappings for the container.
 
     public void setPortMappings(java.util.Collection<PortMappingportMappings) {
         if (portMappings == null) {
             this. = null;
             return;
         }
         portMappingsCopy.addAll(portMappings);
         this. = portMappingsCopy;
     }
    
    
The list of port mappings for the container.

NOTE: This method appends the values to the existing list (if any). Use setPortMappings(java.util.Collection) or withPortMappings(java.util.Collection) if you want to override the existing values.

Returns a reference to this object so that method calls can be chained together.

Parameters:
portMappings The list of port mappings for the container.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public ContainerDefinition withPortMappings(PortMapping... portMappings) {
         if (getPortMappings() == nullsetPortMappings(new java.util.ArrayList<PortMapping>(portMappings.length));
         for (PortMapping value : portMappings) {
             getPortMappings().add(value);
         }
         return this;
     }
    
    
The list of port mappings for the container.

Returns a reference to this object so that method calls can be chained together.

Parameters:
portMappings The list of port mappings for the container.
Returns:
A reference to this updated object so that method calls can be chained together.
 
         if (portMappings == null) {
             this. = null;
         } else {
             com.amazonaws.internal.ListWithAutoConstructFlag<PortMappingportMappingsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<PortMapping>(portMappings.size());
             portMappingsCopy.addAll(portMappings);
             this. = portMappingsCopy;
         }
 
         return this;
     }

    
If the essential parameter of a container is marked as true, the failure of that container will stop the task. If the essential parameter of a container is marked as false, then its failure will not affect the rest of the containers in a task.

Returns:
If the essential parameter of a container is marked as true, the failure of that container will stop the task. If the essential parameter of a container is marked as false, then its failure will not affect the rest of the containers in a task.
 
     public Boolean isEssential() {
         return ;
     }
    
    
If the essential parameter of a container is marked as true, the failure of that container will stop the task. If the essential parameter of a container is marked as false, then its failure will not affect the rest of the containers in a task.

Parameters:
essential If the essential parameter of a container is marked as true, the failure of that container will stop the task. If the essential parameter of a container is marked as false, then its failure will not affect the rest of the containers in a task.
 
     public void setEssential(Boolean essential) {
         this. = essential;
     }
    
    
If the essential parameter of a container is marked as true, the failure of that container will stop the task. If the essential parameter of a container is marked as false, then its failure will not affect the rest of the containers in a task.

Returns a reference to this object so that method calls can be chained together.

Parameters:
essential If the essential parameter of a container is marked as true, the failure of that container will stop the task. If the essential parameter of a container is marked as false, then its failure will not affect the rest of the containers in a task.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public ContainerDefinition withEssential(Boolean essential) {
         this. = essential;
         return this;
     }

    
If the essential parameter of a container is marked as true, the failure of that container will stop the task. If the essential parameter of a container is marked as false, then its failure will not affect the rest of the containers in a task.

Returns:
If the essential parameter of a container is marked as true, the failure of that container will stop the task. If the essential parameter of a container is marked as false, then its failure will not affect the rest of the containers in a task.
 
     public Boolean getEssential() {
         return ;
     }

    
<important>

Early versions of the Amazon ECS container agent do not properly handle entryPoint parameters. If you have problems using entryPoint, update your container agent or enter your commands and arguments as command array items instead. </important>

The ENTRYPOINT that is passed to the container. For more information on the Docker ENTRYPOINT parameter, see https://docs.docker.com/reference/builder/#entrypoint.

Returns:
<important>

Early versions of the Amazon ECS container agent do not properly handle entryPoint parameters. If you have problems using entryPoint, update your container agent or enter your commands and arguments as command array items instead. </important>

The ENTRYPOINT that is passed to the container. For more information on the Docker ENTRYPOINT parameter, see https://docs.docker.com/reference/builder/#entrypoint.

 
     public java.util.List<StringgetEntryPoint() {
         if ( == null) {
                = new com.amazonaws.internal.ListWithAutoConstructFlag<String>();
               .setAutoConstruct(true);
         }
         return ;
     }
    
    
<important>

Early versions of the Amazon ECS container agent do not properly handle entryPoint parameters. If you have problems using entryPoint, update your container agent or enter your commands and arguments as command array items instead. </important>

The ENTRYPOINT that is passed to the container. For more information on the Docker ENTRYPOINT parameter, see https://docs.docker.com/reference/builder/#entrypoint.

Parameters:
entryPoint <important>

Early versions of the Amazon ECS container agent do not properly handle entryPoint parameters. If you have problems using entryPoint, update your container agent or enter your commands and arguments as command array items instead. </important>

The ENTRYPOINT that is passed to the container. For more information on the Docker ENTRYPOINT parameter, see https://docs.docker.com/reference/builder/#entrypoint.

 
     public void setEntryPoint(java.util.Collection<StringentryPoint) {
         if (entryPoint == null) {
             this. = null;
             return;
         }
         entryPointCopy.addAll(entryPoint);
         this. = entryPointCopy;
     }
    
    
<important>

Early versions of the Amazon ECS container agent do not properly handle entryPoint parameters. If you have problems using entryPoint, update your container agent or enter your commands and arguments as command array items instead. </important>

The ENTRYPOINT that is passed to the container. For more information on the Docker ENTRYPOINT parameter, see https://docs.docker.com/reference/builder/#entrypoint.

NOTE: This method appends the values to the existing list (if any). Use setEntryPoint(java.util.Collection) or withEntryPoint(java.util.Collection) if you want to override the existing values.

Returns a reference to this object so that method calls can be chained together.

Parameters:
entryPoint <important>

Early versions of the Amazon ECS container agent do not properly handle entryPoint parameters. If you have problems using entryPoint, update your container agent or enter your commands and arguments as command array items instead. </important>

The ENTRYPOINT that is passed to the container. For more information on the Docker ENTRYPOINT parameter, see https://docs.docker.com/reference/builder/#entrypoint.

Returns:
A reference to this updated object so that method calls can be chained together.
 
     public ContainerDefinition withEntryPoint(String... entryPoint) {
         if (getEntryPoint() == nullsetEntryPoint(new java.util.ArrayList<String>(entryPoint.length));
         for (String value : entryPoint) {
             getEntryPoint().add(value);
         }
         return this;
     }
    
    
<important>

Early versions of the Amazon ECS container agent do not properly handle entryPoint parameters. If you have problems using entryPoint, update your container agent or enter your commands and arguments as command array items instead. </important>

The ENTRYPOINT that is passed to the container. For more information on the Docker ENTRYPOINT parameter, see https://docs.docker.com/reference/builder/#entrypoint.

Returns a reference to this object so that method calls can be chained together.

Parameters:
entryPoint <important>

Early versions of the Amazon ECS container agent do not properly handle entryPoint parameters. If you have problems using entryPoint, update your container agent or enter your commands and arguments as command array items instead. </important>

The ENTRYPOINT that is passed to the container. For more information on the Docker ENTRYPOINT parameter, see https://docs.docker.com/reference/builder/#entrypoint.

Returns:
A reference to this updated object so that method calls can be chained together.
 
     public ContainerDefinition withEntryPoint(java.util.Collection<StringentryPoint) {
         if (entryPoint == null) {
             this. = null;
         } else {
             com.amazonaws.internal.ListWithAutoConstructFlag<StringentryPointCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(entryPoint.size());
             entryPointCopy.addAll(entryPoint);
             this. = entryPointCopy;
         }
 
         return this;
     }

    
The CMD that is passed to the container. For more information on the Docker CMD parameter, see https://docs.docker.com/reference/builder/#cmd.

Returns:
The CMD that is passed to the container. For more information on the Docker CMD parameter, see https://docs.docker.com/reference/builder/#cmd.
 
     public java.util.List<StringgetCommand() {
         if ( == null) {
                = new com.amazonaws.internal.ListWithAutoConstructFlag<String>();
               .setAutoConstruct(true);
         }
         return ;
     }
    
    
The CMD that is passed to the container. For more information on the Docker CMD parameter, see https://docs.docker.com/reference/builder/#cmd.

Parameters:
command The CMD that is passed to the container. For more information on the Docker CMD parameter, see https://docs.docker.com/reference/builder/#cmd.
 
     public void setCommand(java.util.Collection<Stringcommand) {
         if (command == null) {
             this. = null;
             return;
         }
         commandCopy.addAll(command);
         this. = commandCopy;
     }
    
    
The CMD that is passed to the container. For more information on the Docker CMD parameter, see https://docs.docker.com/reference/builder/#cmd.

NOTE: This method appends the values to the existing list (if any). Use setCommand(java.util.Collection) or withCommand(java.util.Collection) if you want to override the existing values.

Returns a reference to this object so that method calls can be chained together.

Parameters:
command The CMD that is passed to the container. For more information on the Docker CMD parameter, see https://docs.docker.com/reference/builder/#cmd.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public ContainerDefinition withCommand(String... command) {
         if (getCommand() == nullsetCommand(new java.util.ArrayList<String>(command.length));
         for (String value : command) {
             getCommand().add(value);
         }
         return this;
     }
    
    
The CMD that is passed to the container. For more information on the Docker CMD parameter, see https://docs.docker.com/reference/builder/#cmd.

Returns a reference to this object so that method calls can be chained together.

Parameters:
command The CMD that is passed to the container. For more information on the Docker CMD parameter, see https://docs.docker.com/reference/builder/#cmd.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public ContainerDefinition withCommand(java.util.Collection<Stringcommand) {
         if (command == null) {
             this. = null;
         } else {
             commandCopy.addAll(command);
             this. = commandCopy;
         }
 
         return this;
     }

    
The environment variables to pass to a container.

Returns:
The environment variables to pass to a container.
 
     public java.util.List<KeyValuePairgetEnvironment() {
         if ( == null) {
                = new com.amazonaws.internal.ListWithAutoConstructFlag<KeyValuePair>();
               .setAutoConstruct(true);
         }
         return ;
     }
    
    
The environment variables to pass to a container.

Parameters:
environment The environment variables to pass to a container.
 
     public void setEnvironment(java.util.Collection<KeyValuePairenvironment) {
         if (environment == null) {
             this. = null;
             return;
         }
         environmentCopy.addAll(environment);
         this. = environmentCopy;
     }
    
    
The environment variables to pass to a container.

NOTE: This method appends the values to the existing list (if any). Use setEnvironment(java.util.Collection) or withEnvironment(java.util.Collection) if you want to override the existing values.

Returns a reference to this object so that method calls can be chained together.

Parameters:
environment The environment variables to pass to a container.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public ContainerDefinition withEnvironment(KeyValuePair... environment) {
         if (getEnvironment() == nullsetEnvironment(new java.util.ArrayList<KeyValuePair>(environment.length));
         for (KeyValuePair value : environment) {
             getEnvironment().add(value);
         }
         return this;
     }
    
    
The environment variables to pass to a container.

Returns a reference to this object so that method calls can be chained together.

Parameters:
environment The environment variables to pass to a container.
Returns:
A reference to this updated object so that method calls can be chained together.
 
         if (environment == null) {
             this. = null;
         } else {
             environmentCopy.addAll(environment);
             this. = environmentCopy;
         }
 
         return this;
     }

    
The mount points for data volumes in your container.

Returns:
The mount points for data volumes in your container.
 
     public java.util.List<MountPointgetMountPoints() {
         if ( == null) {
                = new com.amazonaws.internal.ListWithAutoConstructFlag<MountPoint>();
               .setAutoConstruct(true);
         }
         return ;
     }
    
    
The mount points for data volumes in your container.

Parameters:
mountPoints The mount points for data volumes in your container.
 
     public void setMountPoints(java.util.Collection<MountPointmountPoints) {
         if (mountPoints == null) {
             this. = null;
             return;
         }
         mountPointsCopy.addAll(mountPoints);
         this. = mountPointsCopy;
     }
    
    
The mount points for data volumes in your container.

NOTE: This method appends the values to the existing list (if any). Use setMountPoints(java.util.Collection) or withMountPoints(java.util.Collection) if you want to override the existing values.

Returns a reference to this object so that method calls can be chained together.

Parameters:
mountPoints The mount points for data volumes in your container.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public ContainerDefinition withMountPoints(MountPoint... mountPoints) {
         if (getMountPoints() == nullsetMountPoints(new java.util.ArrayList<MountPoint>(mountPoints.length));
         for (MountPoint value : mountPoints) {
             getMountPoints().add(value);
         }
         return this;
     }
    
    
The mount points for data volumes in your container.

Returns a reference to this object so that method calls can be chained together.

Parameters:
mountPoints The mount points for data volumes in your container.
Returns:
A reference to this updated object so that method calls can be chained together.
 
         if (mountPoints == null) {
             this. = null;
         } else {
             com.amazonaws.internal.ListWithAutoConstructFlag<MountPointmountPointsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<MountPoint>(mountPoints.size());
             mountPointsCopy.addAll(mountPoints);
             this. = mountPointsCopy;
         }
 
         return this;
     }

    
Data volumes to mount from another container.

Returns:
Data volumes to mount from another container.
 
     public java.util.List<VolumeFromgetVolumesFrom() {
         if ( == null) {
                = new com.amazonaws.internal.ListWithAutoConstructFlag<VolumeFrom>();
               .setAutoConstruct(true);
         }
         return ;
     }
    
    
Data volumes to mount from another container.

Parameters:
volumesFrom Data volumes to mount from another container.
 
     public void setVolumesFrom(java.util.Collection<VolumeFromvolumesFrom) {
         if (volumesFrom == null) {
             this. = null;
             return;
         }
         volumesFromCopy.addAll(volumesFrom);
         this. = volumesFromCopy;
     }
    
    
Data volumes to mount from another container.

NOTE: This method appends the values to the existing list (if any). Use setVolumesFrom(java.util.Collection) or withVolumesFrom(java.util.Collection) if you want to override the existing values.

Returns a reference to this object so that method calls can be chained together.

Parameters:
volumesFrom Data volumes to mount from another container.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public ContainerDefinition withVolumesFrom(VolumeFrom... volumesFrom) {
         if (getVolumesFrom() == nullsetVolumesFrom(new java.util.ArrayList<VolumeFrom>(volumesFrom.length));
         for (VolumeFrom value : volumesFrom) {
             getVolumesFrom().add(value);
         }
         return this;
     }
    
    
Data volumes to mount from another container.

Returns a reference to this object so that method calls can be chained together.

Parameters:
volumesFrom Data volumes to mount from another container.
Returns:
A reference to this updated object so that method calls can be chained together.
 
         if (volumesFrom == null) {
             this. = null;
         } else {
             com.amazonaws.internal.ListWithAutoConstructFlag<VolumeFromvolumesFromCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<VolumeFrom>(volumesFrom.size());
             volumesFromCopy.addAll(volumesFrom);
             this. = volumesFromCopy;
         }
 
         return this;
     }

    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
 
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
         sb.append("{");
        if (getName() != nullsb.append("Name: " + getName() + ",");
        if (getImage() != nullsb.append("Image: " + getImage() + ",");
        if (getCpu() != nullsb.append("Cpu: " + getCpu() + ",");
        if (getMemory() != nullsb.append("Memory: " + getMemory() + ",");
        if (getLinks() != nullsb.append("Links: " + getLinks() + ",");
        if (getPortMappings() != nullsb.append("PortMappings: " + getPortMappings() + ",");
        if (isEssential() != nullsb.append("Essential: " + isEssential() + ",");
        if (getEntryPoint() != nullsb.append("EntryPoint: " + getEntryPoint() + ",");
        if (getCommand() != nullsb.append("Command: " + getCommand() + ",");
        if (getEnvironment() != nullsb.append("Environment: " + getEnvironment() + ",");
        if (getMountPoints() != nullsb.append("MountPoints: " + getMountPoints() + ",");
        if (getVolumesFrom() != nullsb.append("VolumesFrom: " + getVolumesFrom() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); 
        hashCode = prime * hashCode + ((getImage() == null) ? 0 : getImage().hashCode()); 
        hashCode = prime * hashCode + ((getCpu() == null) ? 0 : getCpu().hashCode()); 
        hashCode = prime * hashCode + ((getMemory() == null) ? 0 : getMemory().hashCode()); 
        hashCode = prime * hashCode + ((getLinks() == null) ? 0 : getLinks().hashCode()); 
        hashCode = prime * hashCode + ((getPortMappings() == null) ? 0 : getPortMappings().hashCode()); 
        hashCode = prime * hashCode + ((isEssential() == null) ? 0 : isEssential().hashCode()); 
        hashCode = prime * hashCode + ((getEntryPoint() == null) ? 0 : getEntryPoint().hashCode()); 
        hashCode = prime * hashCode + ((getCommand() == null) ? 0 : getCommand().hashCode()); 
        hashCode = prime * hashCode + ((getEnvironment() == null) ? 0 : getEnvironment().hashCode()); 
        hashCode = prime * hashCode + ((getMountPoints() == null) ? 0 : getMountPoints().hashCode()); 
        hashCode = prime * hashCode + ((getVolumesFrom() == null) ? 0 : getVolumesFrom().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof ContainerDefinition == falsereturn false;
        ContainerDefinition other = (ContainerDefinition)obj;
        
        if (other.getName() == null ^ this.getName() == nullreturn false;
        if (other.getName() != null && other.getName().equals(this.getName()) == falsereturn false
        if (other.getImage() == null ^ this.getImage() == nullreturn false;
        if (other.getImage() != null && other.getImage().equals(this.getImage()) == falsereturn false
        if (other.getCpu() == null ^ this.getCpu() == nullreturn false;
        if (other.getCpu() != null && other.getCpu().equals(this.getCpu()) == falsereturn false
        if (other.getMemory() == null ^ this.getMemory() == nullreturn false;
        if (other.getMemory() != null && other.getMemory().equals(this.getMemory()) == falsereturn false
        if (other.getLinks() == null ^ this.getLinks() == nullreturn false;
        if (other.getLinks() != null && other.getLinks().equals(this.getLinks()) == falsereturn false
        if (other.getPortMappings() == null ^ this.getPortMappings() == nullreturn false;
        if (other.getPortMappings() != null && other.getPortMappings().equals(this.getPortMappings()) == falsereturn false
        if (other.isEssential() == null ^ this.isEssential() == nullreturn false;
        if (other.isEssential() != null && other.isEssential().equals(this.isEssential()) == falsereturn false
        if (other.getEntryPoint() == null ^ this.getEntryPoint() == nullreturn false;
        if (other.getEntryPoint() != null && other.getEntryPoint().equals(this.getEntryPoint()) == falsereturn false
        if (other.getCommand() == null ^ this.getCommand() == nullreturn false;
        if (other.getCommand() != null && other.getCommand().equals(this.getCommand()) == falsereturn false
        if (other.getEnvironment() == null ^ this.getEnvironment() == nullreturn false;
        if (other.getEnvironment() != null && other.getEnvironment().equals(this.getEnvironment()) == falsereturn false
        if (other.getMountPoints() == null ^ this.getMountPoints() == nullreturn false;
        if (other.getMountPoints() != null && other.getMountPoints().equals(this.getMountPoints()) == falsereturn false
        if (other.getVolumesFrom() == null ^ this.getVolumesFrom() == nullreturn false;
        if (other.getVolumesFrom() != null && other.getVolumesFrom().equals(this.getVolumesFrom()) == falsereturn false
        return true;
    }
    
    @Override
    public ContainerDefinition clone() {
        try {
            return (ContainerDefinitionsuper.clone();
        
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException(
                    "Got a CloneNotSupportedException from Object.clone() "
                    + "even though we're Cloneable!",
                    e);
        }
        
    }
}
    
New to GrepCode? Check out our FAQ X