com.amazonaws.services.pinpointemail.model.Body Maven / Gradle / Ivy
Show all versions of aws-java-sdk-pinpointemail Show documentation
/*
* 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.pinpointemail.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Represents the body of the email message.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class Body implements Serializable, Cloneable, StructuredPojo {
/**
*
* An object that represents the version of the message that is displayed in email clients that don't support HTML,
* or clients where the recipient has disabled HTML rendering.
*
*/
private Content text;
/**
*
* An object that represents the version of the message that is displayed in email clients that support HTML. HTML
* messages can include formatted text, hyperlinks, images, and more.
*
*/
private Content html;
/**
*
* An object that represents the version of the message that is displayed in email clients that don't support HTML,
* or clients where the recipient has disabled HTML rendering.
*
*
* @param text
* An object that represents the version of the message that is displayed in email clients that don't support
* HTML, or clients where the recipient has disabled HTML rendering.
*/
public void setText(Content text) {
this.text = text;
}
/**
*
* An object that represents the version of the message that is displayed in email clients that don't support HTML,
* or clients where the recipient has disabled HTML rendering.
*
*
* @return An object that represents the version of the message that is displayed in email clients that don't
* support HTML, or clients where the recipient has disabled HTML rendering.
*/
public Content getText() {
return this.text;
}
/**
*
* An object that represents the version of the message that is displayed in email clients that don't support HTML,
* or clients where the recipient has disabled HTML rendering.
*
*
* @param text
* An object that represents the version of the message that is displayed in email clients that don't support
* HTML, or clients where the recipient has disabled HTML rendering.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Body withText(Content text) {
setText(text);
return this;
}
/**
*
* An object that represents the version of the message that is displayed in email clients that support HTML. HTML
* messages can include formatted text, hyperlinks, images, and more.
*
*
* @param html
* An object that represents the version of the message that is displayed in email clients that support HTML.
* HTML messages can include formatted text, hyperlinks, images, and more.
*/
public void setHtml(Content html) {
this.html = html;
}
/**
*
* An object that represents the version of the message that is displayed in email clients that support HTML. HTML
* messages can include formatted text, hyperlinks, images, and more.
*
*
* @return An object that represents the version of the message that is displayed in email clients that support
* HTML. HTML messages can include formatted text, hyperlinks, images, and more.
*/
public Content getHtml() {
return this.html;
}
/**
*
* An object that represents the version of the message that is displayed in email clients that support HTML. HTML
* messages can include formatted text, hyperlinks, images, and more.
*
*
* @param html
* An object that represents the version of the message that is displayed in email clients that support HTML.
* HTML messages can include formatted text, hyperlinks, images, and more.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Body withHtml(Content html) {
setHtml(html);
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 (getText() != null)
sb.append("Text: ").append(getText()).append(",");
if (getHtml() != null)
sb.append("Html: ").append(getHtml());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof Body == false)
return false;
Body other = (Body) obj;
if (other.getText() == null ^ this.getText() == null)
return false;
if (other.getText() != null && other.getText().equals(this.getText()) == false)
return false;
if (other.getHtml() == null ^ this.getHtml() == null)
return false;
if (other.getHtml() != null && other.getHtml().equals(this.getHtml()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getText() == null) ? 0 : getText().hashCode());
hashCode = prime * hashCode + ((getHtml() == null) ? 0 : getHtml().hashCode());
return hashCode;
}
@Override
public Body clone() {
try {
return (Body) 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.pinpointemail.model.transform.BodyMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}