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;
 

The name of a container in a task definition and the command it should run instead of its default.

 
 public class ContainerOverride implements SerializableCloneable {

    
The name of the container that receives the override.
 
     private String name;

    
The command to send to the container that overrides the default command from the Docker image or the task definition.
 
The name of the container that receives the override.

Returns:
The name of the container that receives the override.
 
     public String getName() {
         return ;
     }
    
    
The name of the container that receives the override.

Parameters:
name The name of the container that receives the override.
 
     public void setName(String name) {
         this. = name;
     }
    
    
The name of the container that receives the override.

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

Parameters:
name The name of the container that receives the override.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public ContainerOverride withName(String name) {
         this. = name;
         return this;
     }

    
The command to send to the container that overrides the default command from the Docker image or the task definition.

Returns:
The command to send to the container that overrides the default command from the Docker image or the task definition.
 
     public java.util.List<StringgetCommand() {
         if ( == null) {
                = new com.amazonaws.internal.ListWithAutoConstructFlag<String>();
               .setAutoConstruct(true);
         }
         return ;
     }
    
    
The command to send to the container that overrides the default command from the Docker image or the task definition.

Parameters:
command The command to send to the container that overrides the default command from the Docker image or the task definition.
 
     public void setCommand(java.util.Collection<Stringcommand) {
         if (command == null) {
             this. = null;
             return;
         }
         commandCopy.addAll(command);
        this. = commandCopy;
    }
    
    
The command to send to the container that overrides the default command from the Docker image or the task definition.

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 command to send to the container that overrides the default command from the Docker image or the task definition.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ContainerOverride withCommand(String... command) {
        if (getCommand() == nullsetCommand(new java.util.ArrayList<String>(command.length));
        for (String value : command) {
            getCommand().add(value);
        }
        return this;
    }
    
    
The command to send to the container that overrides the default command from the Docker image or the task definition.

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

Parameters:
command The command to send to the container that overrides the default command from the Docker image or the task definition.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (command == null) {
            this. = null;
        } else {
            commandCopy.addAll(command);
            this. = commandCopy;
        }
        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 (getCommand() != nullsb.append("Command: " + getCommand() );
        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 + ((getCommand() == null) ? 0 : getCommand().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof ContainerOverride == falsereturn false;
        ContainerOverride other = (ContainerOverride)obj;
        
        if (other.getName() == null ^ this.getName() == nullreturn false;
        if (other.getName() != null && other.getName().equals(this.getName()) == falsereturn false
        if (other.getCommand() == null ^ this.getCommand() == nullreturn false;
        if (other.getCommand() != null && other.getCommand().equals(this.getCommand()) == falsereturn false
        return true;
    }
    
    @Override
    public ContainerOverride clone() {
        try {
            return (ContainerOverridesuper.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