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 for the parameters to the RegisterTaskDefinition operation.

Registers a new task definition from the supplied family and containerDefinitions . Optionally, you can add data volumes to your containers with the volumes parameter. For more information on task definition parameters and defaults, see Amazon ECS Task Definitions in the Amazon EC2 Container Service Developer Guide .

 
 public class RegisterTaskDefinitionRequest extends AmazonWebServiceRequest implements SerializableCloneable {

    
You must specify a family for a task definition, which allows you to track multiple versions of the same task definition. You can think of the family as a name for your task definition. Up to 255 letters (uppercase and lowercase), numbers, hyphens, and underscores are allowed.
 
     private String family;

    
A list of container definitions in JSON format that describe the different containers that make up your task.
 
A list of volume definitions in JSON format that containers in your task may use.
 
You must specify a family for a task definition, which allows you to track multiple versions of the same task definition. You can think of the family as a name for your task definition. Up to 255 letters (uppercase and lowercase), numbers, hyphens, and underscores are allowed.

Returns:
You must specify a family for a task definition, which allows you to track multiple versions of the same task definition. You can think of the family as a name for your task definition. Up to 255 letters (uppercase and lowercase), numbers, hyphens, and underscores are allowed.
 
     public String getFamily() {
         return ;
     }
    
    
You must specify a family for a task definition, which allows you to track multiple versions of the same task definition. You can think of the family as a name for your task definition. Up to 255 letters (uppercase and lowercase), numbers, hyphens, and underscores are allowed.

Parameters:
family You must specify a family for a task definition, which allows you to track multiple versions of the same task definition. You can think of the family as a name for your task definition. Up to 255 letters (uppercase and lowercase), numbers, hyphens, and underscores are allowed.
 
     public void setFamily(String family) {
         this. = family;
     }
    
    
You must specify a family for a task definition, which allows you to track multiple versions of the same task definition. You can think of the family as a name for your task definition. Up to 255 letters (uppercase and lowercase), numbers, hyphens, and underscores are allowed.

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

Parameters:
family You must specify a family for a task definition, which allows you to track multiple versions of the same task definition. You can think of the family as a name for your task definition. Up to 255 letters (uppercase and lowercase), numbers, hyphens, and underscores are allowed.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = family;
        return this;
    }

    
A list of container definitions in JSON format that describe the different containers that make up your task.

Returns:
A list of container definitions in JSON format that describe the different containers that make up your task.
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
A list of container definitions in JSON format that describe the different containers that make up your task.

Parameters:
containerDefinitions A list of container definitions in JSON format that describe the different containers that make up your task.
    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.

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.
Returns:
A reference to this updated object so that method calls can be chained together.
        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.

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.
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;
    }

    
A list of volume definitions in JSON format that containers in your task may use.

Returns:
A list of volume definitions in JSON format that containers in your task may use.
    public java.util.List<VolumegetVolumes() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<Volume>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
A list of volume definitions in JSON format that containers in your task may use.

Parameters:
volumes A list of volume definitions in JSON format that containers in your task may use.
    public void setVolumes(java.util.Collection<Volumevolumes) {
        if (volumes == null) {
            this. = null;
            return;
        }
        volumesCopy.addAll(volumes);
        this. = volumesCopy;
    }
    
    
A list of volume definitions in JSON format that containers in your task may use.

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 A list of volume definitions in JSON format that containers in your task may use.
Returns:
A reference to this updated object so that method calls can be chained together.
    public RegisterTaskDefinitionRequest withVolumes(Volume... volumes) {
        if (getVolumes() == nullsetVolumes(new java.util.ArrayList<Volume>(volumes.length));
        for (Volume value : volumes) {
            getVolumes().add(value);
        }
        return this;
    }
    
    
A list of volume definitions in JSON format that containers in your task may use.

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

Parameters:
volumes A list of volume definitions in JSON format that containers in your task may use.
Returns:
A reference to this updated object so that method calls can be chained together.
        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 (getFamily() != nullsb.append("Family: " + getFamily() + ",");
        if (getContainerDefinitions() != nullsb.append("ContainerDefinitions: " + getContainerDefinitions() + ",");
        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 + ((getFamily() == null) ? 0 : getFamily().hashCode()); 
        hashCode = prime * hashCode + ((getContainerDefinitions() == null) ? 0 : getContainerDefinitions().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 RegisterTaskDefinitionRequest == falsereturn false;
        
        if (other.getFamily() == null ^ this.getFamily() == nullreturn false;
        if (other.getFamily() != null && other.getFamily().equals(this.getFamily()) == falsereturn false
        if (other.getContainerDefinitions() == null ^ this.getContainerDefinitions() == nullreturn false;
        if (other.getContainerDefinitions() != null && other.getContainerDefinitions().equals(this.getContainerDefinitions()) == falsereturn false
        if (other.getVolumes() == null ^ this.getVolumes() == nullreturn false;
        if (other.getVolumes() != null && other.getVolumes().equals(this.getVolumes()) == falsereturn false
        return true;
    }
    
    @Override
        
            return (RegisterTaskDefinitionRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X