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 RegisterContainerInstance operation.

NOTE: This action is only used by the Amazon EC2 Container Service agent, and it is not intended for use outside of the agent.

Registers an Amazon EC2 instance into the specified cluster. This instance will become available to place containers on.

 
 public class RegisterContainerInstanceRequest extends AmazonWebServiceRequest implements SerializableCloneable {

    
The short name or full Amazon Resource Name (ARN) of the cluster that you want to register your container instance with. If you do not specify a cluster, the default cluster is assumed..
 
     private String cluster;

    
 
     private String instanceIdentityDocument;

    
 
     private String instanceIdentityDocumentSignature;

    
 
 
     private VersionInfo versionInfo;

    
The short name or full Amazon Resource Name (ARN) of the cluster that you want to register your container instance with. If you do not specify a cluster, the default cluster is assumed..

Returns:
The short name or full Amazon Resource Name (ARN) of the cluster that you want to register your container instance with. If you do not specify a cluster, the default cluster is assumed..
 
     public String getCluster() {
         return ;
     }
    
    
The short name or full Amazon Resource Name (ARN) of the cluster that you want to register your container instance with. If you do not specify a cluster, the default cluster is assumed..

Parameters:
cluster The short name or full Amazon Resource Name (ARN) of the cluster that you want to register your container instance with. If you do not specify a cluster, the default cluster is assumed..
 
     public void setCluster(String cluster) {
         this. = cluster;
     }
    
    
The short name or full Amazon Resource Name (ARN) of the cluster that you want to register your container instance with. If you do not specify a cluster, the default cluster is assumed..

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

Parameters:
cluster The short name or full Amazon Resource Name (ARN) of the cluster that you want to register your container instance with. If you do not specify a cluster, the default cluster is assumed..
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = cluster;
        return this;
    }

    

Returns:
        return ;
    }
    
    

Parameters:
instanceIdentityDocument
    public void setInstanceIdentityDocument(String instanceIdentityDocument) {
        this. = instanceIdentityDocument;
    }
    
    

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

Parameters:
instanceIdentityDocument
Returns:
A reference to this updated object so that method calls can be chained together.
    public RegisterContainerInstanceRequest withInstanceIdentityDocument(String instanceIdentityDocument) {
        this. = instanceIdentityDocument;
        return this;
    }

    

Returns:
        return ;
    }
    
    

Parameters:
instanceIdentityDocumentSignature
    public void setInstanceIdentityDocumentSignature(String instanceIdentityDocumentSignature) {
        this. = instanceIdentityDocumentSignature;
    }
    
    

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

Parameters:
instanceIdentityDocumentSignature
Returns:
A reference to this updated object so that method calls can be chained together.
    public RegisterContainerInstanceRequest withInstanceIdentityDocumentSignature(String instanceIdentityDocumentSignature) {
        this. = instanceIdentityDocumentSignature;
        return this;
    }

    

Returns:
    public java.util.List<ResourcegetTotalResources() {
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    

Parameters:
totalResources
    public void setTotalResources(java.util.Collection<ResourcetotalResources) {
        if (totalResources == null) {
            this. = null;
            return;
        }
        com.amazonaws.internal.ListWithAutoConstructFlag<ResourcetotalResourcesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<Resource>(totalResources.size());
        totalResourcesCopy.addAll(totalResources);
        this. = totalResourcesCopy;
    }
    
    

NOTE: This method appends the values to the existing list (if any). Use setTotalResources(java.util.Collection) or withTotalResources(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:
totalResources
Returns:
A reference to this updated object so that method calls can be chained together.
    public RegisterContainerInstanceRequest withTotalResources(Resource... totalResources) {
        if (getTotalResources() == nullsetTotalResources(new java.util.ArrayList<Resource>(totalResources.length));
        for (Resource value : totalResources) {
            getTotalResources().add(value);
        }
        return this;
    }
    
    

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

Parameters:
totalResources
Returns:
A reference to this updated object so that method calls can be chained together.
        if (totalResources == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<ResourcetotalResourcesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<Resource>(totalResources.size());
            totalResourcesCopy.addAll(totalResources);
            this. = totalResourcesCopy;
        }
        return this;
    }

    

Returns:
    public VersionInfo getVersionInfo() {
        return ;
    }
    
    

Parameters:
versionInfo
    public void setVersionInfo(VersionInfo versionInfo) {
        this. = versionInfo;
    }
    
    

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

Parameters:
versionInfo
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = versionInfo;
        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 (getCluster() != nullsb.append("Cluster: " + getCluster() + ",");
        if (getInstanceIdentityDocument() != nullsb.append("InstanceIdentityDocument: " + getInstanceIdentityDocument() + ",");
        if (getInstanceIdentityDocumentSignature() != nullsb.append("InstanceIdentityDocumentSignature: " + getInstanceIdentityDocumentSignature() + ",");
        if (getTotalResources() != nullsb.append("TotalResources: " + getTotalResources() + ",");
        if (getVersionInfo() != nullsb.append("VersionInfo: " + getVersionInfo() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getCluster() == null) ? 0 : getCluster().hashCode()); 
        hashCode = prime * hashCode + ((getInstanceIdentityDocument() == null) ? 0 : getInstanceIdentityDocument().hashCode()); 
        hashCode = prime * hashCode + ((getInstanceIdentityDocumentSignature() == null) ? 0 : getInstanceIdentityDocumentSignature().hashCode()); 
        hashCode = prime * hashCode + ((getTotalResources() == null) ? 0 : getTotalResources().hashCode()); 
        hashCode = prime * hashCode + ((getVersionInfo() == null) ? 0 : getVersionInfo().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof RegisterContainerInstanceRequest == falsereturn false;
        
        if (other.getCluster() == null ^ this.getCluster() == nullreturn false;
        if (other.getCluster() != null && other.getCluster().equals(this.getCluster()) == falsereturn false
        if (other.getInstanceIdentityDocument() == null ^ this.getInstanceIdentityDocument() == nullreturn false;
        if (other.getInstanceIdentityDocument() != null && other.getInstanceIdentityDocument().equals(this.getInstanceIdentityDocument()) == falsereturn false
        if (other.getInstanceIdentityDocumentSignature() == null ^ this.getInstanceIdentityDocumentSignature() == nullreturn false;
        if (other.getInstanceIdentityDocumentSignature() != null && other.getInstanceIdentityDocumentSignature().equals(this.getInstanceIdentityDocumentSignature()) == falsereturn false
        if (other.getTotalResources() == null ^ this.getTotalResources() == nullreturn false;
        if (other.getTotalResources() != null && other.getTotalResources().equals(this.getTotalResources()) == falsereturn false
        if (other.getVersionInfo() == null ^ this.getVersionInfo() == nullreturn false;
        if (other.getVersionInfo() != null && other.getVersionInfo().equals(this.getVersionInfo()) == falsereturn false
        return true;
    }
    
    @Override
        
            return (RegisterContainerInstanceRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X