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 the data feed for a Spot Instance.

 
 public class SpotDatafeedSubscription implements SerializableCloneable {

    
The AWS account ID of the account.
 
     private String ownerId;

    
The Amazon S3 bucket where the Spot Instance data feed is located.
 
     private String bucket;

    
The prefix that is prepended to data feed files.
 
     private String prefix;

    
The state of the Spot Instance data feed subscription.

Constraints:
Allowed Values: Active, Inactive

 
     private String state;

    
The fault codes for the Spot Instance request, if any.
 
     private SpotInstanceStateFault fault;

    
The AWS account ID of the account.

Returns:
The AWS account ID of the account.
 
     public String getOwnerId() {
         return ;
     }
    
    
The AWS account ID of the account.

Parameters:
ownerId The AWS account ID of the account.
 
     public void setOwnerId(String ownerId) {
         this. = ownerId;
     }
    
    
The AWS account ID of the account.

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

Parameters:
ownerId The AWS account ID of the account.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public SpotDatafeedSubscription withOwnerId(String ownerId) {
         this. = ownerId;
         return this;
     }

    
The Amazon S3 bucket where the Spot Instance data feed is located.

Returns:
The Amazon S3 bucket where the Spot Instance data feed is located.
 
     public String getBucket() {
         return ;
     }
    
    
The Amazon S3 bucket where the Spot Instance data feed is located.

Parameters:
bucket The Amazon S3 bucket where the Spot Instance data feed is located.
    public void setBucket(String bucket) {
        this. = bucket;
    }
    
    
The Amazon S3 bucket where the Spot Instance data feed is located.

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

Parameters:
bucket The Amazon S3 bucket where the Spot Instance data feed is located.
Returns:
A reference to this updated object so that method calls can be chained together.
    public SpotDatafeedSubscription withBucket(String bucket) {
        this. = bucket;
        return this;
    }

    
The prefix that is prepended to data feed files.

Returns:
The prefix that is prepended to data feed files.
    public String getPrefix() {
        return ;
    }
    
    
The prefix that is prepended to data feed files.

Parameters:
prefix The prefix that is prepended to data feed files.
    public void setPrefix(String prefix) {
        this. = prefix;
    }
    
    
The prefix that is prepended to data feed files.

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

Parameters:
prefix The prefix that is prepended to data feed files.
Returns:
A reference to this updated object so that method calls can be chained together.
    public SpotDatafeedSubscription withPrefix(String prefix) {
        this. = prefix;
        return this;
    }

    
The state of the Spot Instance data feed subscription.

Constraints:
Allowed Values: Active, Inactive

Returns:
The state of the Spot Instance data feed subscription.
See also:
DatafeedSubscriptionState
    public String getState() {
        return ;
    }
    
    
The state of the Spot Instance data feed subscription.

Constraints:
Allowed Values: Active, Inactive

Parameters:
state The state of the Spot Instance data feed subscription.
See also:
DatafeedSubscriptionState
    public void setState(String state) {
        this. = state;
    }
    
    
The state of the Spot Instance data feed subscription.

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

Constraints:
Allowed Values: Active, Inactive

Parameters:
state The state of the Spot Instance data feed subscription.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
DatafeedSubscriptionState
    public SpotDatafeedSubscription withState(String state) {
        this. = state;
        return this;
    }

    
The state of the Spot Instance data feed subscription.

Constraints:
Allowed Values: Active, Inactive

Parameters:
state The state of the Spot Instance data feed subscription.
See also:
DatafeedSubscriptionState
    public void setState(DatafeedSubscriptionState state) {
        this. = state.toString();
    }
    
    
The state of the Spot Instance data feed subscription.

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

Constraints:
Allowed Values: Active, Inactive

Parameters:
state The state of the Spot Instance data feed subscription.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
DatafeedSubscriptionState
        this. = state.toString();
        return this;
    }

    
The fault codes for the Spot Instance request, if any.

Returns:
The fault codes for the Spot Instance request, if any.
    public SpotInstanceStateFault getFault() {
        return ;
    }
    
    
The fault codes for the Spot Instance request, if any.

Parameters:
fault The fault codes for the Spot Instance request, if any.
    public void setFault(SpotInstanceStateFault fault) {
        this. = fault;
    }
    
    
The fault codes for the Spot Instance request, if any.

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

Parameters:
fault The fault codes for the Spot Instance request, if any.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = fault;
        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 (getOwnerId() != nullsb.append("OwnerId: " + getOwnerId() + ",");
        if (getBucket() != nullsb.append("Bucket: " + getBucket() + ",");
        if (getPrefix() != nullsb.append("Prefix: " + getPrefix() + ",");
        if (getState() != nullsb.append("State: " + getState() + ",");
        if (getFault() != nullsb.append("Fault: " + getFault() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getOwnerId() == null) ? 0 : getOwnerId().hashCode()); 
        hashCode = prime * hashCode + ((getBucket() == null) ? 0 : getBucket().hashCode()); 
        hashCode = prime * hashCode + ((getPrefix() == null) ? 0 : getPrefix().hashCode()); 
        hashCode = prime * hashCode + ((getState() == null) ? 0 : getState().hashCode()); 
        hashCode = prime * hashCode + ((getFault() == null) ? 0 : getFault().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof SpotDatafeedSubscription == falsereturn false;
        SpotDatafeedSubscription other = (SpotDatafeedSubscription)obj;
        
        if (other.getOwnerId() == null ^ this.getOwnerId() == nullreturn false;
        if (other.getOwnerId() != null && other.getOwnerId().equals(this.getOwnerId()) == falsereturn false
        if (other.getBucket() == null ^ this.getBucket() == nullreturn false;
        if (other.getBucket() != null && other.getBucket().equals(this.getBucket()) == falsereturn false
        if (other.getPrefix() == null ^ this.getPrefix() == nullreturn false;
        if (other.getPrefix() != null && other.getPrefix().equals(this.getPrefix()) == falsereturn false
        if (other.getState() == null ^ this.getState() == nullreturn false;
        if (other.getState() != null && other.getState().equals(this.getState()) == falsereturn false
        if (other.getFault() == null ^ this.getFault() == nullreturn false;
        if (other.getFault() != null && other.getFault().equals(this.getFault()) == falsereturn false
        return true;
    }
    
    @Override
    public SpotDatafeedSubscription clone() {
        try {
            return (SpotDatafeedSubscriptionsuper.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