/* * Copyright 2010-2018 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; /** *

* Describes a Spot fleet event. *

*/ public class EventInformation implements Serializable { /** * The ID of the instance. This information is available only for * instanceChange events. */ private String instanceId; /** * The event.

The following are the error events.

*

The following are the fleetRequestChange events.

The following are * the instanceChange events.

*/ private String eventSubType; /** * The description of the event. */ private String eventDescription; /** * The ID of the instance. This information is available only for * instanceChange events. * * @return The ID of the instance. This information is available only for * instanceChange events. */ public String getInstanceId() { return instanceId; } /** * The ID of the instance. This information is available only for * instanceChange events. * * @param instanceId The ID of the instance. This information is available only for * instanceChange events. */ public void setInstanceId(String instanceId) { this.instanceId = instanceId; } /** * The ID of the instance. This information is available only for * instanceChange events. *

* Returns a reference to this object so that method calls can be chained together. * * @param instanceId The ID of the instance. This information is available only for * instanceChange events. * * @return A reference to this updated object so that method calls can be chained * together. */ public EventInformation withInstanceId(String instanceId) { this.instanceId = instanceId; return this; } /** * The event.

The following are the error events.

*

The following are the fleetRequestChange events.

The following are * the instanceChange events.

* * @return The event.

The following are the error events.

*

The following are the fleetRequestChange events.

The following are * the instanceChange events.

*/ public String getEventSubType() { return eventSubType; } /** * The event.

The following are the error events.

*

The following are the fleetRequestChange events.

The following are * the instanceChange events.

* * @param eventSubType The event.

The following are the error events.

*

The following are the fleetRequestChange events.

The following are * the instanceChange events.

*/ public void setEventSubType(String eventSubType) { this.eventSubType = eventSubType; } /** * The event.

The following are the error events.

*

The following are the fleetRequestChange events.

The following are * the instanceChange events.

*

* Returns a reference to this object so that method calls can be chained together. * * @param eventSubType The event.

The following are the error events.

*

The following are the fleetRequestChange events.

The following are * the instanceChange events.

* * @return A reference to this updated object so that method calls can be chained * together. */ public EventInformation withEventSubType(String eventSubType) { this.eventSubType = eventSubType; return this; } /** * The description of the event. * * @return The description of the event. */ public String getEventDescription() { return eventDescription; } /** * The description of the event. * * @param eventDescription The description of the event. */ public void setEventDescription(String eventDescription) { this.eventDescription = eventDescription; } /** * The description of the event. *

* Returns a reference to this object so that method calls can be chained together. * * @param eventDescription The description of the event. * * @return A reference to this updated object so that method calls can be chained * together. */ public EventInformation withEventDescription(String eventDescription) { this.eventDescription = eventDescription; return this; } /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getInstanceId() != null) sb.append("InstanceId: " + getInstanceId() + ","); if (getEventSubType() != null) sb.append("EventSubType: " + getEventSubType() + ","); if (getEventDescription() != null) sb.append("EventDescription: " + getEventDescription() ); 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 + ((getEventSubType() == null) ? 0 : getEventSubType().hashCode()); hashCode = prime * hashCode + ((getEventDescription() == null) ? 0 : getEventDescription().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof EventInformation == false) return false; EventInformation other = (EventInformation)obj; if (other.getInstanceId() == null ^ this.getInstanceId() == null) return false; if (other.getInstanceId() != null && other.getInstanceId().equals(this.getInstanceId()) == false) return false; if (other.getEventSubType() == null ^ this.getEventSubType() == null) return false; if (other.getEventSubType() != null && other.getEventSubType().equals(this.getEventSubType()) == false) return false; if (other.getEventDescription() == null ^ this.getEventDescription() == null) return false; if (other.getEventDescription() != null && other.getEventDescription().equals(this.getEventDescription()) == false) return false; return true; } }