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

Describes scaling activity, which is a long-running process that represents a change to your Auto Scaling group, such as changing its size or replacing an instance.

 
 public class Activity implements SerializableCloneable {

    
The ID of the activity.

Constraints:
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

 
     private String activityId;

    
The name of the Auto Scaling group.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

 
     private String autoScalingGroupName;

    
A friendly, more verbose description of the activity.

Constraints:
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

 
     private String description;

    
The reason the activity began.

Constraints:
Length: 1 - 1023
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

 
     private String cause;

    
The start time of the activity.
 
     private java.util.Date startTime;

    
The end time of the activity.
 
     private java.util.Date endTime;

    
The current status of the activity.

Constraints:
Allowed Values: WaitingForSpotInstanceRequestId, WaitingForSpotInstanceId, WaitingForInstanceId, PreInService, InProgress, WaitingForELBConnectionDraining, MidLifecycleAction, Successful, Failed, Cancelled

 
     private String statusCode;

    
A friendly, more verbose description of the activity status.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

 
     private String statusMessage;

    
A value between 0 and 100 that indicates the progress of the activity.
 
     private Integer progress;

    
The details about the activity.

Constraints:
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

 
    private String details;

    
The ID of the activity.

Constraints:
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Returns:
The ID of the activity.
    public String getActivityId() {
        return ;
    }
    
    
The ID of the activity.

Constraints:
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
activityId The ID of the activity.
    public void setActivityId(String activityId) {
        this. = activityId;
    }
    
    
The ID of the activity.

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

Constraints:
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
activityId The ID of the activity.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Activity withActivityId(String activityId) {
        this. = activityId;
        return this;
    }

    
The name of the Auto Scaling group.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Returns:
The name of the Auto Scaling group.
    public String getAutoScalingGroupName() {
        return ;
    }
    
    
The name of the Auto Scaling group.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
autoScalingGroupName The name of the Auto Scaling group.
    public void setAutoScalingGroupName(String autoScalingGroupName) {
        this. = autoScalingGroupName;
    }
    
    
The name of the Auto Scaling group.

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

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
autoScalingGroupName The name of the Auto Scaling group.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Activity withAutoScalingGroupName(String autoScalingGroupName) {
        this. = autoScalingGroupName;
        return this;
    }

    
A friendly, more verbose description of the activity.

Constraints:
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Returns:
A friendly, more verbose description of the activity.
    public String getDescription() {
        return ;
    }
    
    
A friendly, more verbose description of the activity.

Constraints:
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
description A friendly, more verbose description of the activity.
    public void setDescription(String description) {
        this. = description;
    }
    
    
A friendly, more verbose description of the activity.

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

Constraints:
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
description A friendly, more verbose description of the activity.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Activity withDescription(String description) {
        this. = description;
        return this;
    }

    
The reason the activity began.

Constraints:
Length: 1 - 1023
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Returns:
The reason the activity began.
    public String getCause() {
        return ;
    }
    
    
The reason the activity began.

Constraints:
Length: 1 - 1023
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
cause The reason the activity began.
    public void setCause(String cause) {
        this. = cause;
    }
    
    
The reason the activity began.

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

Constraints:
Length: 1 - 1023
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
cause The reason the activity began.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Activity withCause(String cause) {
        this. = cause;
        return this;
    }

    
The start time of the activity.

Returns:
The start time of the activity.
    public java.util.Date getStartTime() {
        return ;
    }
    
    
The start time of the activity.

Parameters:
startTime The start time of the activity.
    public void setStartTime(java.util.Date startTime) {
        this. = startTime;
    }
    
    
The start time of the activity.

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

Parameters:
startTime The start time of the activity.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Activity withStartTime(java.util.Date startTime) {
        this. = startTime;
        return this;
    }

    
The end time of the activity.

Returns:
The end time of the activity.
    public java.util.Date getEndTime() {
        return ;
    }
    
    
The end time of the activity.

Parameters:
endTime The end time of the activity.
    public void setEndTime(java.util.Date endTime) {
        this. = endTime;
    }
    
    
The end time of the activity.

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

Parameters:
endTime The end time of the activity.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Activity withEndTime(java.util.Date endTime) {
        this. = endTime;
        return this;
    }

    
The current status of the activity.

Constraints:
Allowed Values: WaitingForSpotInstanceRequestId, WaitingForSpotInstanceId, WaitingForInstanceId, PreInService, InProgress, WaitingForELBConnectionDraining, MidLifecycleAction, Successful, Failed, Cancelled

Returns:
The current status of the activity.
See also:
ScalingActivityStatusCode
    public String getStatusCode() {
        return ;
    }
    
    
The current status of the activity.

Constraints:
Allowed Values: WaitingForSpotInstanceRequestId, WaitingForSpotInstanceId, WaitingForInstanceId, PreInService, InProgress, WaitingForELBConnectionDraining, MidLifecycleAction, Successful, Failed, Cancelled

Parameters:
statusCode The current status of the activity.
See also:
ScalingActivityStatusCode
    public void setStatusCode(String statusCode) {
        this. = statusCode;
    }
    
    
The current status of the activity.

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

Constraints:
Allowed Values: WaitingForSpotInstanceRequestId, WaitingForSpotInstanceId, WaitingForInstanceId, PreInService, InProgress, WaitingForELBConnectionDraining, MidLifecycleAction, Successful, Failed, Cancelled

Parameters:
statusCode The current status of the activity.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
ScalingActivityStatusCode
    public Activity withStatusCode(String statusCode) {
        this. = statusCode;
        return this;
    }

    
The current status of the activity.

Constraints:
Allowed Values: WaitingForSpotInstanceRequestId, WaitingForSpotInstanceId, WaitingForInstanceId, PreInService, InProgress, WaitingForELBConnectionDraining, MidLifecycleAction, Successful, Failed, Cancelled

Parameters:
statusCode The current status of the activity.
See also:
ScalingActivityStatusCode
    public void setStatusCode(ScalingActivityStatusCode statusCode) {
        this. = statusCode.toString();
    }
    
    
The current status of the activity.

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

Constraints:
Allowed Values: WaitingForSpotInstanceRequestId, WaitingForSpotInstanceId, WaitingForInstanceId, PreInService, InProgress, WaitingForELBConnectionDraining, MidLifecycleAction, Successful, Failed, Cancelled

Parameters:
statusCode The current status of the activity.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
ScalingActivityStatusCode
    public Activity withStatusCode(ScalingActivityStatusCode statusCode) {
        this. = statusCode.toString();
        return this;
    }

    
A friendly, more verbose description of the activity status.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Returns:
A friendly, more verbose description of the activity status.
    public String getStatusMessage() {
        return ;
    }
    
    
A friendly, more verbose description of the activity status.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
statusMessage A friendly, more verbose description of the activity status.
    public void setStatusMessage(String statusMessage) {
        this. = statusMessage;
    }
    
    
A friendly, more verbose description of the activity status.

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

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
statusMessage A friendly, more verbose description of the activity status.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Activity withStatusMessage(String statusMessage) {
        this. = statusMessage;
        return this;
    }

    
A value between 0 and 100 that indicates the progress of the activity.

Returns:
A value between 0 and 100 that indicates the progress of the activity.
    public Integer getProgress() {
        return ;
    }
    
    
A value between 0 and 100 that indicates the progress of the activity.

Parameters:
progress A value between 0 and 100 that indicates the progress of the activity.
    public void setProgress(Integer progress) {
        this. = progress;
    }
    
    
A value between 0 and 100 that indicates the progress of the activity.

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

Parameters:
progress A value between 0 and 100 that indicates the progress of the activity.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Activity withProgress(Integer progress) {
        this. = progress;
        return this;
    }

    
The details about the activity.

Constraints:
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Returns:
The details about the activity.
    public String getDetails() {
        return ;
    }
    
    
The details about the activity.

Constraints:
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
details The details about the activity.
    public void setDetails(String details) {
        this. = details;
    }
    
    
The details about the activity.

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

Constraints:
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
details The details about the activity.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Activity withDetails(String details) {
        this. = details;
        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 (getActivityId() != nullsb.append("ActivityId: " + getActivityId() + ",");
        if (getAutoScalingGroupName() != nullsb.append("AutoScalingGroupName: " + getAutoScalingGroupName() + ",");
        if (getDescription() != nullsb.append("Description: " + getDescription() + ",");
        if (getCause() != nullsb.append("Cause: " + getCause() + ",");
        if (getStartTime() != nullsb.append("StartTime: " + getStartTime() + ",");
        if (getEndTime() != nullsb.append("EndTime: " + getEndTime() + ",");
        if (getStatusCode() != nullsb.append("StatusCode: " + getStatusCode() + ",");
        if (getStatusMessage() != nullsb.append("StatusMessage: " + getStatusMessage() + ",");
        if (getProgress() != nullsb.append("Progress: " + getProgress() + ",");
        if (getDetails() != nullsb.append("Details: " + getDetails() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getActivityId() == null) ? 0 : getActivityId().hashCode()); 
        hashCode = prime * hashCode + ((getAutoScalingGroupName() == null) ? 0 : getAutoScalingGroupName().hashCode()); 
        hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); 
        hashCode = prime * hashCode + ((getCause() == null) ? 0 : getCause().hashCode()); 
        hashCode = prime * hashCode + ((getStartTime() == null) ? 0 : getStartTime().hashCode()); 
        hashCode = prime * hashCode + ((getEndTime() == null) ? 0 : getEndTime().hashCode()); 
        hashCode = prime * hashCode + ((getStatusCode() == null) ? 0 : getStatusCode().hashCode()); 
        hashCode = prime * hashCode + ((getStatusMessage() == null) ? 0 : getStatusMessage().hashCode()); 
        hashCode = prime * hashCode + ((getProgress() == null) ? 0 : getProgress().hashCode()); 
        hashCode = prime * hashCode + ((getDetails() == null) ? 0 : getDetails().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof Activity == falsereturn false;
        Activity other = (Activity)obj;
        
        if (other.getActivityId() == null ^ this.getActivityId() == nullreturn false;
        if (other.getActivityId() != null && other.getActivityId().equals(this.getActivityId()) == falsereturn false
        if (other.getAutoScalingGroupName() == null ^ this.getAutoScalingGroupName() == nullreturn false;
        if (other.getAutoScalingGroupName() != null && other.getAutoScalingGroupName().equals(this.getAutoScalingGroupName()) == falsereturn false
        if (other.getDescription() == null ^ this.getDescription() == nullreturn false;
        if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == falsereturn false
        if (other.getCause() == null ^ this.getCause() == nullreturn false;
        if (other.getCause() != null && other.getCause().equals(this.getCause()) == falsereturn false
        if (other.getStartTime() == null ^ this.getStartTime() == nullreturn false;
        if (other.getStartTime() != null && other.getStartTime().equals(this.getStartTime()) == falsereturn false
        if (other.getEndTime() == null ^ this.getEndTime() == nullreturn false;
        if (other.getEndTime() != null && other.getEndTime().equals(this.getEndTime()) == falsereturn false
        if (other.getStatusCode() == null ^ this.getStatusCode() == nullreturn false;
        if (other.getStatusCode() != null && other.getStatusCode().equals(this.getStatusCode()) == falsereturn false
        if (other.getStatusMessage() == null ^ this.getStatusMessage() == nullreturn false;
        if (other.getStatusMessage() != null && other.getStatusMessage().equals(this.getStatusMessage()) == falsereturn false
        if (other.getProgress() == null ^ this.getProgress() == nullreturn false;
        if (other.getProgress() != null && other.getProgress().equals(this.getProgress()) == falsereturn false
        if (other.getDetails() == null ^ this.getDetails() == nullreturn false;
        if (other.getDetails() != null && other.getDetails().equals(this.getDetails()) == falsereturn false
        return true;
    }
    
    @Override
    public Activity clone() {
        try {
            return (Activitysuper.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