com.amazonaws.services.health.model.EventDetails Maven / Gradle / Ivy
Show all versions of aws-java-sdk-health Show documentation
/*
* Copyright 2014-2019 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.health.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Detailed information about an event. A combination of an Event object, an EventDescription object, and
* additional metadata about the event. Returned by the DescribeEventDetails operation.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class EventDetails implements Serializable, Cloneable, StructuredPojo {
/**
*
* Summary information about the event.
*
*/
private Event event;
/**
*
* The most recent description of the event.
*
*/
private EventDescription eventDescription;
/**
*
* Additional metadata about the event.
*
*/
private java.util.Map eventMetadata;
/**
*
* Summary information about the event.
*
*
* @param event
* Summary information about the event.
*/
public void setEvent(Event event) {
this.event = event;
}
/**
*
* Summary information about the event.
*
*
* @return Summary information about the event.
*/
public Event getEvent() {
return this.event;
}
/**
*
* Summary information about the event.
*
*
* @param event
* Summary information about the event.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EventDetails withEvent(Event event) {
setEvent(event);
return this;
}
/**
*
* The most recent description of the event.
*
*
* @param eventDescription
* The most recent description of the event.
*/
public void setEventDescription(EventDescription eventDescription) {
this.eventDescription = eventDescription;
}
/**
*
* The most recent description of the event.
*
*
* @return The most recent description of the event.
*/
public EventDescription getEventDescription() {
return this.eventDescription;
}
/**
*
* The most recent description of the event.
*
*
* @param eventDescription
* The most recent description of the event.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EventDetails withEventDescription(EventDescription eventDescription) {
setEventDescription(eventDescription);
return this;
}
/**
*
* Additional metadata about the event.
*
*
* @return Additional metadata about the event.
*/
public java.util.Map getEventMetadata() {
return eventMetadata;
}
/**
*
* Additional metadata about the event.
*
*
* @param eventMetadata
* Additional metadata about the event.
*/
public void setEventMetadata(java.util.Map eventMetadata) {
this.eventMetadata = eventMetadata;
}
/**
*
* Additional metadata about the event.
*
*
* @param eventMetadata
* Additional metadata about the event.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EventDetails withEventMetadata(java.util.Map eventMetadata) {
setEventMetadata(eventMetadata);
return this;
}
public EventDetails addEventMetadataEntry(String key, String value) {
if (null == this.eventMetadata) {
this.eventMetadata = new java.util.HashMap();
}
if (this.eventMetadata.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.eventMetadata.put(key, value);
return this;
}
/**
* Removes all the entries added into EventMetadata.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EventDetails clearEventMetadataEntries() {
this.eventMetadata = null;
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 (getEvent() != null)
sb.append("Event: ").append(getEvent()).append(",");
if (getEventDescription() != null)
sb.append("EventDescription: ").append(getEventDescription()).append(",");
if (getEventMetadata() != null)
sb.append("EventMetadata: ").append(getEventMetadata());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof EventDetails == false)
return false;
EventDetails other = (EventDetails) obj;
if (other.getEvent() == null ^ this.getEvent() == null)
return false;
if (other.getEvent() != null && other.getEvent().equals(this.getEvent()) == false)
return false;
if (other.getEventDescription() == null ^ this.getEventDescription() == null)
return false;
if (other.getEventDescription() != null && other.getEventDescription().equals(this.getEventDescription()) == false)
return false;
if (other.getEventMetadata() == null ^ this.getEventMetadata() == null)
return false;
if (other.getEventMetadata() != null && other.getEventMetadata().equals(this.getEventMetadata()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getEvent() == null) ? 0 : getEvent().hashCode());
hashCode = prime * hashCode + ((getEventDescription() == null) ? 0 : getEventDescription().hashCode());
hashCode = prime * hashCode + ((getEventMetadata() == null) ? 0 : getEventMetadata().hashCode());
return hashCode;
}
@Override
public EventDetails clone() {
try {
return (EventDetails) 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.health.model.transform.EventDetailsMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}