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;
 
 
 public class TaskDefinition implements SerializableCloneable {

    
The full Amazon Resource Name (ARN) of the of the task definition.
 
     private String taskDefinitionArn;

    
A list of container definitions in JSON format that describe the different containers that make up your task. For more information on container definition parameters and defaults, see Amazon ECS Task Definitions in the Amazon EC2 Container Service Developer Guide.
 
The family of your task definition. You can think of the family as the name of your task definition.
 
     private String family;

    
The revision of the task in a particular family. You can think of the revision as a version number of a task definition in a family. When you register a task definition for the first time, the revision is 1, and each time you register a task definition in the same family, the revision value increases by one.
 
     private Integer revision;

    
The list of volumes in a task. For more information on volume definition parameters and defaults, see Amazon ECS Task Definitions in the Amazon EC2 Container Service Developer Guide.
 
The full Amazon Resource Name (ARN) of the of the task definition.

Returns:
The full Amazon Resource Name (ARN) of the of the task definition.
 
     public String getTaskDefinitionArn() {
         return ;
     }
    
    
The full Amazon Resource Name (ARN) of the of the task definition.

Parameters:
taskDefinitionArn The full Amazon Resource Name (ARN) of the of the task definition.
 
     public void setTaskDefinitionArn(String taskDefinitionArn) {
         this. = taskDefinitionArn;
     }
    
    
The full Amazon Resource Name (ARN) of the of the task definition.

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

Parameters:
taskDefinitionArn The full Amazon Resource Name (ARN) of the of the task definition.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public TaskDefinition withTaskDefinitionArn(String taskDefinitionArn) {
         this. = taskDefinitionArn;
         return this;
     }

    
A list of container definitions in JSON format that describe the different containers that make up your task. For more information on container definition parameters and defaults, see Amazon ECS Task Definitions in the Amazon EC2 Container Service Developer Guide.

Returns:
A list of container definitions in JSON format that describe the different containers that make up your task. For more information on container definition parameters and defaults, see Amazon ECS Task Definitions in the Amazon EC2 Container Service Developer Guide.
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
A list of container definitions in JSON format that describe the different containers that make up your task. For more information on container definition parameters and defaults, see Amazon ECS Task Definitions in the Amazon EC2 Container Service Developer Guide.

Parameters:
containerDefinitions A list of container definitions in JSON format that describe the different containers that make up your task. For more information on container definition parameters and defaults, see Amazon ECS Task Definitions in the Amazon EC2 Container Service Developer Guide.
    public void setContainerDefinitions(java.util.Collection<ContainerDefinitioncontainerDefinitions) {
        if (containerDefinitions == null) {
            this. = null;
            return;
        }
        containerDefinitionsCopy.addAll(containerDefinitions);
        this. = containerDefinitionsCopy;
    }
    
    
A list of container definitions in JSON format that describe the different containers that make up your task. For more information on container definition parameters and defaults, see Amazon ECS Task Definitions in the Amazon EC2 Container Service Developer Guide.

NOTE: This method appends the values to the existing list (if any). Use setContainerDefinitions(java.util.Collection) or withContainerDefinitions(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:
containerDefinitions A list of container definitions in JSON format that describe the different containers that make up your task. For more information on container definition parameters and defaults, see Amazon ECS Task Definitions in the Amazon EC2 Container Service Developer Guide.
Returns:
A reference to this updated object so that method calls can be chained together.
    public TaskDefinition withContainerDefinitions(ContainerDefinition... containerDefinitions) {
        if (getContainerDefinitions() == nullsetContainerDefinitions(new java.util.ArrayList<ContainerDefinition>(containerDefinitions.length));
        for (ContainerDefinition value : containerDefinitions) {
            getContainerDefinitions().add(value);
        }
        return this;
    }
    
    
A list of container definitions in JSON format that describe the different containers that make up your task. For more information on container definition parameters and defaults, see Amazon ECS Task Definitions in the Amazon EC2 Container Service Developer Guide.

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

Parameters:
containerDefinitions A list of container definitions in JSON format that describe the different containers that make up your task. For more information on container definition parameters and defaults, see Amazon ECS Task Definitions in the Amazon EC2 Container Service Developer Guide.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (containerDefinitions == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<ContainerDefinitioncontainerDefinitionsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<ContainerDefinition>(containerDefinitions.size());
            containerDefinitionsCopy.addAll(containerDefinitions);
            this. = containerDefinitionsCopy;
        }
        return this;
    }

    
The family of your task definition. You can think of the family as the name of your task definition.

Returns:
The family of your task definition. You can think of the family as the name of your task definition.
    public String getFamily() {
        return ;
    }
    
    
The family of your task definition. You can think of the family as the name of your task definition.

Parameters:
family The family of your task definition. You can think of the family as the name of your task definition.
    public void setFamily(String family) {
        this. = family;
    }
    
    
The family of your task definition. You can think of the family as the name of your task definition.

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

Parameters:
family The family of your task definition. You can think of the family as the name of your task definition.
Returns:
A reference to this updated object so that method calls can be chained together.
    public TaskDefinition withFamily(String family) {
        this. = family;
        return this;
    }

    
The revision of the task in a particular family. You can think of the revision as a version number of a task definition in a family. When you register a task definition for the first time, the revision is 1, and each time you register a task definition in the same family, the revision value increases by one.

Returns:
The revision of the task in a particular family. You can think of the revision as a version number of a task definition in a family. When you register a task definition for the first time, the revision is 1, and each time you register a task definition in the same family, the revision value increases by one.
    public Integer getRevision() {
        return ;
    }
    
    
The revision of the task in a particular family. You can think of the revision as a version number of a task definition in a family. When you register a task definition for the first time, the revision is 1, and each time you register a task definition in the same family, the revision value increases by one.

Parameters:
revision The revision of the task in a particular family. You can think of the revision as a version number of a task definition in a family. When you register a task definition for the first time, the revision is 1, and each time you register a task definition in the same family, the revision value increases by one.
    public void setRevision(Integer revision) {
        this. = revision;
    }
    
    
The revision of the task in a particular family. You can think of the revision as a version number of a task definition in a family. When you register a task definition for the first time, the revision is 1, and each time you register a task definition in the same family, the revision value increases by one.

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

Parameters:
revision The revision of the task in a particular family. You can think of the revision as a version number of a task definition in a family. When you register a task definition for the first time, the revision is 1, and each time you register a task definition in the same family, the revision value increases by one.
Returns:
A reference to this updated object so that method calls can be chained together.
    public TaskDefinition withRevision(Integer revision) {
        this. = revision;
        return this;
    }

    
The list of volumes in a task. For more information on volume definition parameters and defaults, see Amazon ECS Task Definitions in the Amazon EC2 Container Service Developer Guide.

Returns:
The list of volumes in a task. For more information on volume definition parameters and defaults, see Amazon ECS Task Definitions in the Amazon EC2 Container Service Developer Guide.
    public java.util.List<VolumegetVolumes() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<Volume>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
The list of volumes in a task. For more information on volume definition parameters and defaults, see Amazon ECS Task Definitions in the Amazon EC2 Container Service Developer Guide.

Parameters:
volumes The list of volumes in a task. For more information on volume definition parameters and defaults, see Amazon ECS Task Definitions in the Amazon EC2 Container Service Developer Guide.
    public void setVolumes(java.util.Collection<Volumevolumes) {
        if (volumes == null) {
            this. = null;
            return;
        }
        volumesCopy.addAll(volumes);
        this. = volumesCopy;
    }
    
    
The list of volumes in a task. For more information on volume definition parameters and defaults, see Amazon ECS Task Definitions in the Amazon EC2 Container Service Developer Guide.

NOTE: This method appends the values to the existing list (if any). Use setVolumes(java.util.Collection) or withVolumes(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:
volumes The list of volumes in a task. For more information on volume definition parameters and defaults, see Amazon ECS Task Definitions in the Amazon EC2 Container Service Developer Guide.
Returns:
A reference to this updated object so that method calls can be chained together.
    public TaskDefinition withVolumes(Volume... volumes) {
        if (getVolumes() == nullsetVolumes(new java.util.ArrayList<Volume>(volumes.length));
        for (Volume value : volumes) {
            getVolumes().add(value);
        }
        return this;
    }
    
    
The list of volumes in a task. For more information on volume definition parameters and defaults, see Amazon ECS Task Definitions in the Amazon EC2 Container Service Developer Guide.

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

Parameters:
volumes The list of volumes in a task. For more information on volume definition parameters and defaults, see Amazon ECS Task Definitions in the Amazon EC2 Container Service Developer Guide.
Returns:
A reference to this updated object so that method calls can be chained together.
    public TaskDefinition withVolumes(java.util.Collection<Volumevolumes) {
        if (volumes == null) {
            this. = null;
        } else {
            volumesCopy.addAll(volumes);
            this. = volumesCopy;
        }
        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 (getTaskDefinitionArn() != nullsb.append("TaskDefinitionArn: " + getTaskDefinitionArn() + ",");
        if (getContainerDefinitions() != nullsb.append("ContainerDefinitions: " + getContainerDefinitions() + ",");
        if (getFamily() != nullsb.append("Family: " + getFamily() + ",");
        if (getRevision() != nullsb.append("Revision: " + getRevision() + ",");
        if (getVolumes() != nullsb.append("Volumes: " + getVolumes() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getTaskDefinitionArn() == null) ? 0 : getTaskDefinitionArn().hashCode()); 
        hashCode = prime * hashCode + ((getContainerDefinitions() == null) ? 0 : getContainerDefinitions().hashCode()); 
        hashCode = prime * hashCode + ((getFamily() == null) ? 0 : getFamily().hashCode()); 
        hashCode = prime * hashCode + ((getRevision() == null) ? 0 : getRevision().hashCode()); 
        hashCode = prime * hashCode + ((getVolumes() == null) ? 0 : getVolumes().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof TaskDefinition == falsereturn false;
        TaskDefinition other = (TaskDefinition)obj;
        
        if (other.getTaskDefinitionArn() == null ^ this.getTaskDefinitionArn() == nullreturn false;
        if (other.getTaskDefinitionArn() != null && other.getTaskDefinitionArn().equals(this.getTaskDefinitionArn()) == falsereturn false
        if (other.getContainerDefinitions() == null ^ this.getContainerDefinitions() == nullreturn false;
        if (other.getContainerDefinitions() != null && other.getContainerDefinitions().equals(this.getContainerDefinitions()) == falsereturn false
        if (other.getFamily() == null ^ this.getFamily() == nullreturn false;
        if (other.getFamily() != null && other.getFamily().equals(this.getFamily()) == falsereturn false
        if (other.getRevision() == null ^ this.getRevision() == nullreturn false;
        if (other.getRevision() != null && other.getRevision().equals(this.getRevision()) == falsereturn false
        if (other.getVolumes() == null ^ this.getVolumes() == nullreturn false;
        if (other.getVolumes() != null && other.getVolumes().equals(this.getVolumes()) == falsereturn false
        return true;
    }
    
    @Override
    public TaskDefinition clone() {
        try {
            return (TaskDefinitionsuper.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