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

Describes a bundle task.

 
 public class BundleTask implements SerializableCloneable {

    
The ID of the instance associated with this bundle task.
 
     private String instanceId;

    
The ID of the bundle task.
 
     private String bundleId;

    
The state of the task.

Constraints:
Allowed Values: pending, waiting-for-shutdown, bundling, storing, cancelling, complete, failed

 
     private String state;

    
The time this task started.
 
     private java.util.Date startTime;

    
The time of the most recent update for the task.
 
     private java.util.Date updateTime;

    
The Amazon S3 storage locations.
 
     private Storage storage;

    
The level of task completion, as a percent (for example, 20%).
 
     private String progress;

    
If the task fails, a description of the error.
 
     private BundleTaskError bundleTaskError;

    
The ID of the instance associated with this bundle task.

Returns:
The ID of the instance associated with this bundle task.
 
     public String getInstanceId() {
         return ;
     }
    
    
The ID of the instance associated with this bundle task.

Parameters:
instanceId The ID of the instance associated with this bundle task.
 
     public void setInstanceId(String instanceId) {
         this. = instanceId;
     }
    
    
The ID of the instance associated with this bundle task.

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

Parameters:
instanceId The ID of the instance associated with this bundle task.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public BundleTask withInstanceId(String instanceId) {
         this. = instanceId;
         return this;
    }

    
The ID of the bundle task.

Returns:
The ID of the bundle task.
    public String getBundleId() {
        return ;
    }
    
    
The ID of the bundle task.

Parameters:
bundleId The ID of the bundle task.
    public void setBundleId(String bundleId) {
        this. = bundleId;
    }
    
    
The ID of the bundle task.

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

Parameters:
bundleId The ID of the bundle task.
Returns:
A reference to this updated object so that method calls can be chained together.
    public BundleTask withBundleId(String bundleId) {
        this. = bundleId;
        return this;
    }

    
The state of the task.

Constraints:
Allowed Values: pending, waiting-for-shutdown, bundling, storing, cancelling, complete, failed

Returns:
The state of the task.
See also:
BundleTaskState
    public String getState() {
        return ;
    }
    
    
The state of the task.

Constraints:
Allowed Values: pending, waiting-for-shutdown, bundling, storing, cancelling, complete, failed

Parameters:
state The state of the task.
See also:
BundleTaskState
    public void setState(String state) {
        this. = state;
    }
    
    
The state of the task.

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

Constraints:
Allowed Values: pending, waiting-for-shutdown, bundling, storing, cancelling, complete, failed

Parameters:
state The state of the task.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
BundleTaskState
    public BundleTask withState(String state) {
        this. = state;
        return this;
    }

    
The state of the task.

Constraints:
Allowed Values: pending, waiting-for-shutdown, bundling, storing, cancelling, complete, failed

Parameters:
state The state of the task.
See also:
BundleTaskState
    public void setState(BundleTaskState state) {
        this. = state.toString();
    }
    
    
The state of the task.

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

Constraints:
Allowed Values: pending, waiting-for-shutdown, bundling, storing, cancelling, complete, failed

Parameters:
state The state of the task.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
BundleTaskState
    public BundleTask withState(BundleTaskState state) {
        this. = state.toString();
        return this;
    }

    
The time this task started.

Returns:
The time this task started.
    public java.util.Date getStartTime() {
        return ;
    }
    
    
The time this task started.

Parameters:
startTime The time this task started.
    public void setStartTime(java.util.Date startTime) {
        this. = startTime;
    }
    
    
The time this task started.

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

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

    
The time of the most recent update for the task.

Returns:
The time of the most recent update for the task.
    public java.util.Date getUpdateTime() {
        return ;
    }
    
    
The time of the most recent update for the task.

Parameters:
updateTime The time of the most recent update for the task.
    public void setUpdateTime(java.util.Date updateTime) {
        this. = updateTime;
    }
    
    
The time of the most recent update for the task.

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

Parameters:
updateTime The time of the most recent update for the task.
Returns:
A reference to this updated object so that method calls can be chained together.
    public BundleTask withUpdateTime(java.util.Date updateTime) {
        this. = updateTime;
        return this;
    }

    
The Amazon S3 storage locations.

Returns:
The Amazon S3 storage locations.
    public Storage getStorage() {
        return ;
    }
    
    
The Amazon S3 storage locations.

Parameters:
storage The Amazon S3 storage locations.
    public void setStorage(Storage storage) {
        this. = storage;
    }
    
    
The Amazon S3 storage locations.

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

Parameters:
storage The Amazon S3 storage locations.
Returns:
A reference to this updated object so that method calls can be chained together.
    public BundleTask withStorage(Storage storage) {
        this. = storage;
        return this;
    }

    
The level of task completion, as a percent (for example, 20%).

Returns:
The level of task completion, as a percent (for example, 20%).
    public String getProgress() {
        return ;
    }
    
    
The level of task completion, as a percent (for example, 20%).

Parameters:
progress The level of task completion, as a percent (for example, 20%).
    public void setProgress(String progress) {
        this. = progress;
    }
    
    
The level of task completion, as a percent (for example, 20%).

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

Parameters:
progress The level of task completion, as a percent (for example, 20%).
Returns:
A reference to this updated object so that method calls can be chained together.
    public BundleTask withProgress(String progress) {
        this. = progress;
        return this;
    }

    
If the task fails, a description of the error.

Returns:
If the task fails, a description of the error.
        return ;
    }
    
    
If the task fails, a description of the error.

Parameters:
bundleTaskError If the task fails, a description of the error.
    public void setBundleTaskError(BundleTaskError bundleTaskError) {
        this. = bundleTaskError;
    }
    
    
If the task fails, a description of the error.

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

Parameters:
bundleTaskError If the task fails, a description of the error.
Returns:
A reference to this updated object so that method calls can be chained together.
    public BundleTask withBundleTaskError(BundleTaskError bundleTaskError) {
        this. = bundleTaskError;
        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 (getInstanceId() != nullsb.append("InstanceId: " + getInstanceId() + ",");
        if (getBundleId() != nullsb.append("BundleId: " + getBundleId() + ",");
        if (getState() != nullsb.append("State: " + getState() + ",");
        if (getStartTime() != nullsb.append("StartTime: " + getStartTime() + ",");
        if (getUpdateTime() != nullsb.append("UpdateTime: " + getUpdateTime() + ",");
        if (getStorage() != nullsb.append("Storage: " + getStorage() + ",");
        if (getProgress() != nullsb.append("Progress: " + getProgress() + ",");
        if (getBundleTaskError() != nullsb.append("BundleTaskError: " + getBundleTaskError() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getInstanceId() == null) ? 0 : getInstanceId().hashCode()); 
        hashCode = prime * hashCode + ((getBundleId() == null) ? 0 : getBundleId().hashCode()); 
        hashCode = prime * hashCode + ((getState() == null) ? 0 : getState().hashCode()); 
        hashCode = prime * hashCode + ((getStartTime() == null) ? 0 : getStartTime().hashCode()); 
        hashCode = prime * hashCode + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); 
        hashCode = prime * hashCode + ((getStorage() == null) ? 0 : getStorage().hashCode()); 
        hashCode = prime * hashCode + ((getProgress() == null) ? 0 : getProgress().hashCode()); 
        hashCode = prime * hashCode + ((getBundleTaskError() == null) ? 0 : getBundleTaskError().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof BundleTask == falsereturn false;
        BundleTask other = (BundleTask)obj;
        
        if (other.getInstanceId() == null ^ this.getInstanceId() == nullreturn false;
        if (other.getInstanceId() != null && other.getInstanceId().equals(this.getInstanceId()) == falsereturn false
        if (other.getBundleId() == null ^ this.getBundleId() == nullreturn false;
        if (other.getBundleId() != null && other.getBundleId().equals(this.getBundleId()) == falsereturn false
        if (other.getState() == null ^ this.getState() == nullreturn false;
        if (other.getState() != null && other.getState().equals(this.getState()) == falsereturn false
        if (other.getStartTime() == null ^ this.getStartTime() == nullreturn false;
        if (other.getStartTime() != null && other.getStartTime().equals(this.getStartTime()) == falsereturn false
        if (other.getUpdateTime() == null ^ this.getUpdateTime() == nullreturn false;
        if (other.getUpdateTime() != null && other.getUpdateTime().equals(this.getUpdateTime()) == falsereturn false
        if (other.getStorage() == null ^ this.getStorage() == nullreturn false;
        if (other.getStorage() != null && other.getStorage().equals(this.getStorage()) == falsereturn false
        if (other.getProgress() == null ^ this.getProgress() == nullreturn false;
        if (other.getProgress() != null && other.getProgress().equals(this.getProgress()) == falsereturn false
        if (other.getBundleTaskError() == null ^ this.getBundleTaskError() == nullreturn false;
        if (other.getBundleTaskError() != null && other.getBundleTaskError().equals(this.getBundleTaskError()) == falsereturn false
        return true;
    }
    
    @Override
    public BundleTask clone() {
        try {
            return (BundleTasksuper.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