/* * 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.databasemigrationservice.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* Describes an identifiable significant activity that affects a replication instance or task. This object can provide * the message, the available event categories, the date and source of the event, and the DMS resource type. *
* * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class Event implements Serializable, Cloneable, StructuredPojo { /** ** The identifier of an event source. *
*/ private String sourceIdentifier; /** ** The type of DMS resource that generates events. *
** Valid values: replication-instance | endpoint | replication-task *
*/ private String sourceType; /** ** The event message. *
*/ private String message; /** ** The event categories available for the specified source type. *
*/ private java.util.List* The date of the event. *
*/ private java.util.Date date; /** ** The identifier of an event source. *
* * @param sourceIdentifier * The identifier of an event source. */ public void setSourceIdentifier(String sourceIdentifier) { this.sourceIdentifier = sourceIdentifier; } /** ** The identifier of an event source. *
* * @return The identifier of an event source. */ public String getSourceIdentifier() { return this.sourceIdentifier; } /** ** The identifier of an event source. *
* * @param sourceIdentifier * The identifier of an event source. * @return Returns a reference to this object so that method calls can be chained together. */ public Event withSourceIdentifier(String sourceIdentifier) { setSourceIdentifier(sourceIdentifier); return this; } /** ** The type of DMS resource that generates events. *
** Valid values: replication-instance | endpoint | replication-task *
* * @param sourceType * The type of DMS resource that generates events. ** Valid values: replication-instance | endpoint | replication-task * @see SourceType */ public void setSourceType(String sourceType) { this.sourceType = sourceType; } /** *
* The type of DMS resource that generates events. *
** Valid values: replication-instance | endpoint | replication-task *
* * @return The type of DMS resource that generates events. ** Valid values: replication-instance | endpoint | replication-task * @see SourceType */ public String getSourceType() { return this.sourceType; } /** *
* The type of DMS resource that generates events. *
** Valid values: replication-instance | endpoint | replication-task *
* * @param sourceType * The type of DMS resource that generates events. ** Valid values: replication-instance | endpoint | replication-task * @return Returns a reference to this object so that method calls can be chained together. * @see SourceType */ public Event withSourceType(String sourceType) { setSourceType(sourceType); return this; } /** *
* The type of DMS resource that generates events. *
** Valid values: replication-instance | endpoint | replication-task *
* * @param sourceType * The type of DMS resource that generates events. ** Valid values: replication-instance | endpoint | replication-task * @see SourceType */ public void setSourceType(SourceType sourceType) { withSourceType(sourceType); } /** *
* The type of DMS resource that generates events. *
** Valid values: replication-instance | endpoint | replication-task *
* * @param sourceType * The type of DMS resource that generates events. ** Valid values: replication-instance | endpoint | replication-task * @return Returns a reference to this object so that method calls can be chained together. * @see SourceType */ public Event withSourceType(SourceType sourceType) { this.sourceType = sourceType.toString(); return this; } /** *
* The event message. *
* * @param message * The event message. */ public void setMessage(String message) { this.message = message; } /** ** The event message. *
* * @return The event message. */ public String getMessage() { return this.message; } /** ** The event message. *
* * @param message * The event message. * @return Returns a reference to this object so that method calls can be chained together. */ public Event withMessage(String message) { setMessage(message); return this; } /** ** The event categories available for the specified source type. *
* * @return The event categories available for the specified source type. */ public java.util.List* The event categories available for the specified source type. *
* * @param eventCategories * The event categories available for the specified source type. */ public void setEventCategories(java.util.Collection* The event categories available for the specified source type. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setEventCategories(java.util.Collection)} or {@link #withEventCategories(java.util.Collection)} if you * want to override the existing values. *
* * @param eventCategories * The event categories available for the specified source type. * @return Returns a reference to this object so that method calls can be chained together. */ public Event withEventCategories(String... eventCategories) { if (this.eventCategories == null) { setEventCategories(new java.util.ArrayList* The event categories available for the specified source type. *
* * @param eventCategories * The event categories available for the specified source type. * @return Returns a reference to this object so that method calls can be chained together. */ public Event withEventCategories(java.util.Collection* The date of the event. *
* * @param date * The date of the event. */ public void setDate(java.util.Date date) { this.date = date; } /** ** The date of the event. *
* * @return The date of the event. */ public java.util.Date getDate() { return this.date; } /** ** The date of the event. *
* * @param date * The date of the event. * @return Returns a reference to this object so that method calls can be chained together. */ public Event withDate(java.util.Date date) { setDate(date); 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 (getSourceIdentifier() != null) sb.append("SourceIdentifier: ").append(getSourceIdentifier()).append(","); if (getSourceType() != null) sb.append("SourceType: ").append(getSourceType()).append(","); if (getMessage() != null) sb.append("Message: ").append(getMessage()).append(","); if (getEventCategories() != null) sb.append("EventCategories: ").append(getEventCategories()).append(","); if (getDate() != null) sb.append("Date: ").append(getDate()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Event == false) return false; Event other = (Event) obj; if (other.getSourceIdentifier() == null ^ this.getSourceIdentifier() == null) return false; if (other.getSourceIdentifier() != null && other.getSourceIdentifier().equals(this.getSourceIdentifier()) == false) return false; if (other.getSourceType() == null ^ this.getSourceType() == null) return false; if (other.getSourceType() != null && other.getSourceType().equals(this.getSourceType()) == false) return false; if (other.getMessage() == null ^ this.getMessage() == null) return false; if (other.getMessage() != null && other.getMessage().equals(this.getMessage()) == false) return false; if (other.getEventCategories() == null ^ this.getEventCategories() == null) return false; if (other.getEventCategories() != null && other.getEventCategories().equals(this.getEventCategories()) == false) return false; if (other.getDate() == null ^ this.getDate() == null) return false; if (other.getDate() != null && other.getDate().equals(this.getDate()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getSourceIdentifier() == null) ? 0 : getSourceIdentifier().hashCode()); hashCode = prime * hashCode + ((getSourceType() == null) ? 0 : getSourceType().hashCode()); hashCode = prime * hashCode + ((getMessage() == null) ? 0 : getMessage().hashCode()); hashCode = prime * hashCode + ((getEventCategories() == null) ? 0 : getEventCategories().hashCode()); hashCode = prime * hashCode + ((getDate() == null) ? 0 : getDate().hashCode()); return hashCode; } @Override public Event clone() { try { return (Event) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } @com.amazonaws.annotation.SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { com.amazonaws.services.databasemigrationservice.model.transform.EventMarshaller.getInstance().marshall(this, protocolMarshaller); } }