/* * Copyright 2018-2023 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; import java.io.Serializable; import javax.annotation.Generated; /** *
* Describes the data feed for a Spot Instance. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class SpotDatafeedSubscription implements Serializable, Cloneable { /** ** The name of the Amazon S3 bucket where the Spot Instance data feed is located. *
*/ private String bucket; /** ** The fault codes for the Spot Instance request, if any. *
*/ private SpotInstanceStateFault fault; /** ** The Amazon Web Services account ID of the account. *
*/ private String ownerId; /** ** The prefix for the data feed files. *
*/ private String prefix; /** ** The state of the Spot Instance data feed subscription. *
*/ private String state; /** ** The name of the Amazon S3 bucket where the Spot Instance data feed is located. *
* * @param bucket * The name of the Amazon S3 bucket where the Spot Instance data feed is located. */ public void setBucket(String bucket) { this.bucket = bucket; } /** ** The name of the Amazon S3 bucket where the Spot Instance data feed is located. *
* * @return The name of the Amazon S3 bucket where the Spot Instance data feed is located. */ public String getBucket() { return this.bucket; } /** ** The name of the Amazon S3 bucket where the Spot Instance data feed is located. *
* * @param bucket * The name of the Amazon S3 bucket where the Spot Instance data feed is located. * @return Returns a reference to this object so that method calls can be chained together. */ public SpotDatafeedSubscription withBucket(String bucket) { setBucket(bucket); return this; } /** ** The fault codes for the Spot Instance request, if any. *
* * @param fault * The fault codes for the Spot Instance request, if any. */ public void setFault(SpotInstanceStateFault fault) { this.fault = fault; } /** ** The fault codes for the Spot Instance request, if any. *
* * @return The fault codes for the Spot Instance request, if any. */ public SpotInstanceStateFault getFault() { return this.fault; } /** ** The fault codes for the Spot Instance request, if any. *
* * @param fault * The fault codes for the Spot Instance request, if any. * @return Returns a reference to this object so that method calls can be chained together. */ public SpotDatafeedSubscription withFault(SpotInstanceStateFault fault) { setFault(fault); return this; } /** ** The Amazon Web Services account ID of the account. *
* * @param ownerId * The Amazon Web Services account ID of the account. */ public void setOwnerId(String ownerId) { this.ownerId = ownerId; } /** ** The Amazon Web Services account ID of the account. *
* * @return The Amazon Web Services account ID of the account. */ public String getOwnerId() { return this.ownerId; } /** ** The Amazon Web Services account ID of the account. *
* * @param ownerId * The Amazon Web Services account ID of the account. * @return Returns a reference to this object so that method calls can be chained together. */ public SpotDatafeedSubscription withOwnerId(String ownerId) { setOwnerId(ownerId); return this; } /** ** The prefix for the data feed files. *
* * @param prefix * The prefix for the data feed files. */ public void setPrefix(String prefix) { this.prefix = prefix; } /** ** The prefix for the data feed files. *
* * @return The prefix for the data feed files. */ public String getPrefix() { return this.prefix; } /** ** The prefix for the data feed files. *
* * @param prefix * The prefix for the data feed files. * @return Returns a reference to this object so that method calls can be chained together. */ public SpotDatafeedSubscription withPrefix(String prefix) { setPrefix(prefix); return this; } /** ** The state of the Spot Instance data feed subscription. *
* * @param state * The state of the Spot Instance data feed subscription. * @see DatafeedSubscriptionState */ public void setState(String state) { this.state = state; } /** ** The state of the Spot Instance data feed subscription. *
* * @return The state of the Spot Instance data feed subscription. * @see DatafeedSubscriptionState */ public String getState() { return this.state; } /** ** The state of the Spot Instance data feed subscription. *
* * @param state * The state of the Spot Instance data feed subscription. * @return Returns a reference to this object so that method calls can be chained together. * @see DatafeedSubscriptionState */ public SpotDatafeedSubscription withState(String state) { setState(state); return this; } /** ** The state of the Spot Instance data feed subscription. *
* * @param state * The state of the Spot Instance data feed subscription. * @see DatafeedSubscriptionState */ public void setState(DatafeedSubscriptionState state) { withState(state); } /** ** The state of the Spot Instance data feed subscription. *
* * @param state * The state of the Spot Instance data feed subscription. * @return Returns a reference to this object so that method calls can be chained together. * @see DatafeedSubscriptionState */ public SpotDatafeedSubscription withState(DatafeedSubscriptionState state) { this.state = state.toString(); return this; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getBucket() != null) sb.append("Bucket: ").append(getBucket()).append(","); if (getFault() != null) sb.append("Fault: ").append(getFault()).append(","); if (getOwnerId() != null) sb.append("OwnerId: ").append(getOwnerId()).append(","); if (getPrefix() != null) sb.append("Prefix: ").append(getPrefix()).append(","); if (getState() != null) sb.append("State: ").append(getState()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof SpotDatafeedSubscription == false) return false; SpotDatafeedSubscription other = (SpotDatafeedSubscription) obj; if (other.getBucket() == null ^ this.getBucket() == null) return false; if (other.getBucket() != null && other.getBucket().equals(this.getBucket()) == false) return false; if (other.getFault() == null ^ this.getFault() == null) return false; if (other.getFault() != null && other.getFault().equals(this.getFault()) == false) return false; if (other.getOwnerId() == null ^ this.getOwnerId() == null) return false; if (other.getOwnerId() != null && other.getOwnerId().equals(this.getOwnerId()) == false) return false; if (other.getPrefix() == null ^ this.getPrefix() == null) return false; if (other.getPrefix() != null && other.getPrefix().equals(this.getPrefix()) == false) return false; if (other.getState() == null ^ this.getState() == null) return false; if (other.getState() != null && other.getState().equals(this.getState()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getBucket() == null) ? 0 : getBucket().hashCode()); hashCode = prime * hashCode + ((getFault() == null) ? 0 : getFault().hashCode()); hashCode = prime * hashCode + ((getOwnerId() == null) ? 0 : getOwnerId().hashCode()); hashCode = prime * hashCode + ((getPrefix() == null) ? 0 : getPrefix().hashCode()); hashCode = prime * hashCode + ((getState() == null) ? 0 : getState().hashCode()); return hashCode; } @Override public SpotDatafeedSubscription clone() { try { return (SpotDatafeedSubscription) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }