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 Container implements SerializableCloneable {

    
The Amazon Resource Name (ARN) of the container.
 
     private String containerArn;

    
The Amazon Resource Name (ARN) of the task.
 
     private String taskArn;

    
The name of the container.
 
     private String name;

    
The last known status of the container.
 
     private String lastStatus;

    
The exit code returned from the container.
 
     private Integer exitCode;

    
A short (255 max characters) human-readable string to provide additional detail about a running or stopped container.
 
     private String reason;

    
 
The Amazon Resource Name (ARN) of the container.

Returns:
The Amazon Resource Name (ARN) of the container.
 
     public String getContainerArn() {
         return ;
     }
    
    
The Amazon Resource Name (ARN) of the container.

Parameters:
containerArn The Amazon Resource Name (ARN) of the container.
 
     public void setContainerArn(String containerArn) {
         this. = containerArn;
     }
    
    
The Amazon Resource Name (ARN) of the container.

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

Parameters:
containerArn The Amazon Resource Name (ARN) of the container.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public Container withContainerArn(String containerArn) {
         this. = containerArn;
         return this;
     }

    
The Amazon Resource Name (ARN) of the task.

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

Parameters:
taskArn The Amazon Resource Name (ARN) of the task.
    public void setTaskArn(String taskArn) {
        this. = taskArn;
    }
    
    
The Amazon Resource Name (ARN) of the task.

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

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

    
The name of the container.

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

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

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

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

    
The last known status of the container.

Returns:
The last known status of the container.
    public String getLastStatus() {
        return ;
    }
    
    
The last known status of the container.

Parameters:
lastStatus The last known status of the container.
    public void setLastStatus(String lastStatus) {
        this. = lastStatus;
    }
    
    
The last known status of the container.

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

Parameters:
lastStatus The last known status of the container.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Container withLastStatus(String lastStatus) {
        this. = lastStatus;
        return this;
    }

    
The exit code returned from the container.

Returns:
The exit code returned from the container.
    public Integer getExitCode() {
        return ;
    }
    
    
The exit code returned from the container.

Parameters:
exitCode The exit code returned from the container.
    public void setExitCode(Integer exitCode) {
        this. = exitCode;
    }
    
    
The exit code returned from the container.

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

Parameters:
exitCode The exit code returned from the container.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Container withExitCode(Integer exitCode) {
        this. = exitCode;
        return this;
    }

    
A short (255 max characters) human-readable string to provide additional detail about a running or stopped container.

Returns:
A short (255 max characters) human-readable string to provide additional detail about a running or stopped container.
    public String getReason() {
        return ;
    }
    
    
A short (255 max characters) human-readable string to provide additional detail about a running or stopped container.

Parameters:
reason A short (255 max characters) human-readable string to provide additional detail about a running or stopped container.
    public void setReason(String reason) {
        this. = reason;
    }
    
    
A short (255 max characters) human-readable string to provide additional detail about a running or stopped container.

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

Parameters:
reason A short (255 max characters) human-readable string to provide additional detail about a running or stopped container.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Container withReason(String reason) {
        this. = reason;
        return this;
    }

    

Returns:
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    

Parameters:
networkBindings
    public void setNetworkBindings(java.util.Collection<NetworkBindingnetworkBindings) {
        if (networkBindings == null) {
            this. = null;
            return;
        }
        networkBindingsCopy.addAll(networkBindings);
        this. = networkBindingsCopy;
    }
    
    

NOTE: This method appends the values to the existing list (if any). Use setNetworkBindings(java.util.Collection) or withNetworkBindings(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:
networkBindings
Returns:
A reference to this updated object so that method calls can be chained together.
    public Container withNetworkBindings(NetworkBinding... networkBindings) {
        if (getNetworkBindings() == nullsetNetworkBindings(new java.util.ArrayList<NetworkBinding>(networkBindings.length));
        for (NetworkBinding value : networkBindings) {
            getNetworkBindings().add(value);
        }
        return this;
    }
    
    

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

Parameters:
networkBindings
Returns:
A reference to this updated object so that method calls can be chained together.
    public Container withNetworkBindings(java.util.Collection<NetworkBindingnetworkBindings) {
        if (networkBindings == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<NetworkBindingnetworkBindingsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<NetworkBinding>(networkBindings.size());
            networkBindingsCopy.addAll(networkBindings);
            this. = networkBindingsCopy;
        }
        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 (getContainerArn() != nullsb.append("ContainerArn: " + getContainerArn() + ",");
        if (getTaskArn() != nullsb.append("TaskArn: " + getTaskArn() + ",");
        if (getName() != nullsb.append("Name: " + getName() + ",");
        if (getLastStatus() != nullsb.append("LastStatus: " + getLastStatus() + ",");
        if (getExitCode() != nullsb.append("ExitCode: " + getExitCode() + ",");
        if (getReason() != nullsb.append("Reason: " + getReason() + ",");
        if (getNetworkBindings() != nullsb.append("NetworkBindings: " + getNetworkBindings() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getContainerArn() == null) ? 0 : getContainerArn().hashCode()); 
        hashCode = prime * hashCode + ((getTaskArn() == null) ? 0 : getTaskArn().hashCode()); 
        hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); 
        hashCode = prime * hashCode + ((getLastStatus() == null) ? 0 : getLastStatus().hashCode()); 
        hashCode = prime * hashCode + ((getExitCode() == null) ? 0 : getExitCode().hashCode()); 
        hashCode = prime * hashCode + ((getReason() == null) ? 0 : getReason().hashCode()); 
        hashCode = prime * hashCode + ((getNetworkBindings() == null) ? 0 : getNetworkBindings().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof Container == falsereturn false;
        Container other = (Container)obj;
        
        if (other.getContainerArn() == null ^ this.getContainerArn() == nullreturn false;
        if (other.getContainerArn() != null && other.getContainerArn().equals(this.getContainerArn()) == falsereturn false
        if (other.getTaskArn() == null ^ this.getTaskArn() == nullreturn false;
        if (other.getTaskArn() != null && other.getTaskArn().equals(this.getTaskArn()) == falsereturn false
        if (other.getName() == null ^ this.getName() == nullreturn false;
        if (other.getName() != null && other.getName().equals(this.getName()) == falsereturn false
        if (other.getLastStatus() == null ^ this.getLastStatus() == nullreturn false;
        if (other.getLastStatus() != null && other.getLastStatus().equals(this.getLastStatus()) == falsereturn false
        if (other.getExitCode() == null ^ this.getExitCode() == nullreturn false;
        if (other.getExitCode() != null && other.getExitCode().equals(this.getExitCode()) == falsereturn false
        if (other.getReason() == null ^ this.getReason() == nullreturn false;
        if (other.getReason() != null && other.getReason().equals(this.getReason()) == falsereturn false
        if (other.getNetworkBindings() == null ^ this.getNetworkBindings() == nullreturn false;
        if (other.getNetworkBindings() != null && other.getNetworkBindings().equals(this.getNetworkBindings()) == falsereturn false
        return true;
    }
    
    @Override
    public Container clone() {
        try {
            return (Containersuper.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