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.opsworks.model;
 

Summarizes the number of layers, instances, and apps in a stack.

 
 public class StackSummary implements SerializableCloneable {

    
The stack ID.
 
     private String stackId;

    
The stack name.
 
     private String name;

    
The stack's ARN.
 
     private String arn;

    
The number of layers.
 
     private Integer layersCount;

    
The number of apps.
 
     private Integer appsCount;

    
An InstancesCount object with the number of instances in each status.
 
     private InstancesCount instancesCount;

    
The stack ID.

Returns:
The stack ID.
 
     public String getStackId() {
         return ;
     }
    
    
The stack ID.

Parameters:
stackId The stack ID.
 
     public void setStackId(String stackId) {
         this. = stackId;
     }
    
    
The stack ID.

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

Parameters:
stackId The stack ID.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public StackSummary withStackId(String stackId) {
         this. = stackId;
         return this;
     }

    
The stack name.

Returns:
The stack name.
 
     public String getName() {
         return ;
     }
    
    
The stack name.

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

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

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

    
The stack's ARN.

Returns:
The stack's ARN.
    public String getArn() {
        return ;
    }
    
    
The stack's ARN.

Parameters:
arn The stack's ARN.
    public void setArn(String arn) {
        this. = arn;
    }
    
    
The stack's ARN.

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

Parameters:
arn The stack's ARN.
Returns:
A reference to this updated object so that method calls can be chained together.
    public StackSummary withArn(String arn) {
        this. = arn;
        return this;
    }

    
The number of layers.

Returns:
The number of layers.
    public Integer getLayersCount() {
        return ;
    }
    
    
The number of layers.

Parameters:
layersCount The number of layers.
    public void setLayersCount(Integer layersCount) {
        this. = layersCount;
    }
    
    
The number of layers.

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

Parameters:
layersCount The number of layers.
Returns:
A reference to this updated object so that method calls can be chained together.
    public StackSummary withLayersCount(Integer layersCount) {
        this. = layersCount;
        return this;
    }

    
The number of apps.

Returns:
The number of apps.
    public Integer getAppsCount() {
        return ;
    }
    
    
The number of apps.

Parameters:
appsCount The number of apps.
    public void setAppsCount(Integer appsCount) {
        this. = appsCount;
    }
    
    
The number of apps.

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

Parameters:
appsCount The number of apps.
Returns:
A reference to this updated object so that method calls can be chained together.
    public StackSummary withAppsCount(Integer appsCount) {
        this. = appsCount;
        return this;
    }

    
An InstancesCount object with the number of instances in each status.

Returns:
An InstancesCount object with the number of instances in each status.
    public InstancesCount getInstancesCount() {
        return ;
    }
    
    
An InstancesCount object with the number of instances in each status.

Parameters:
instancesCount An InstancesCount object with the number of instances in each status.
    public void setInstancesCount(InstancesCount instancesCount) {
        this. = instancesCount;
    }
    
    
An InstancesCount object with the number of instances in each status.

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

Parameters:
instancesCount An InstancesCount object with the number of instances in each status.
Returns:
A reference to this updated object so that method calls can be chained together.
    public StackSummary withInstancesCount(InstancesCount instancesCount) {
        this. = instancesCount;
        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 (getStackId() != nullsb.append("StackId: " + getStackId() + ",");
        if (getName() != nullsb.append("Name: " + getName() + ",");
        if (getArn() != nullsb.append("Arn: " + getArn() + ",");
        if (getLayersCount() != nullsb.append("LayersCount: " + getLayersCount() + ",");
        if (getAppsCount() != nullsb.append("AppsCount: " + getAppsCount() + ",");
        if (getInstancesCount() != nullsb.append("InstancesCount: " + getInstancesCount() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getStackId() == null) ? 0 : getStackId().hashCode()); 
        hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); 
        hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode()); 
        hashCode = prime * hashCode + ((getLayersCount() == null) ? 0 : getLayersCount().hashCode()); 
        hashCode = prime * hashCode + ((getAppsCount() == null) ? 0 : getAppsCount().hashCode()); 
        hashCode = prime * hashCode + ((getInstancesCount() == null) ? 0 : getInstancesCount().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof StackSummary == falsereturn false;
        StackSummary other = (StackSummary)obj;
        
        if (other.getStackId() == null ^ this.getStackId() == nullreturn false;
        if (other.getStackId() != null && other.getStackId().equals(this.getStackId()) == falsereturn false
        if (other.getName() == null ^ this.getName() == nullreturn false;
        if (other.getName() != null && other.getName().equals(this.getName()) == falsereturn false
        if (other.getArn() == null ^ this.getArn() == nullreturn false;
        if (other.getArn() != null && other.getArn().equals(this.getArn()) == falsereturn false
        if (other.getLayersCount() == null ^ this.getLayersCount() == nullreturn false;
        if (other.getLayersCount() != null && other.getLayersCount().equals(this.getLayersCount()) == falsereturn false
        if (other.getAppsCount() == null ^ this.getAppsCount() == nullreturn false;
        if (other.getAppsCount() != null && other.getAppsCount().equals(this.getAppsCount()) == falsereturn false
        if (other.getInstancesCount() == null ^ this.getInstancesCount() == nullreturn false;
        if (other.getInstancesCount() != null && other.getInstancesCount().equals(this.getInstancesCount()) == falsereturn false
        return true;
    }
    
    @Override
    public StackSummary clone() {
        try {
            return (StackSummarysuper.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