/* * Copyright 2010-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.connect.model; import java.io.Serializable; /** *

* A chat message. *

*/ public class ChatMessage implements Serializable { /** *

* The type of the content. Supported types are text/plain, * text/markdown, application/json, and * application/vnd.amazonaws.connect.message.interactive.response * . *

*

* Constraints:
* Length: 1 - 100
*/ private String contentType; /** *

* The content of the chat message. *

* *

* Constraints:
* Length: 1 - 16384
*/ private String content; /** *

* The type of the content. Supported types are text/plain, * text/markdown, application/json, and * application/vnd.amazonaws.connect.message.interactive.response * . *

*

* Constraints:
* Length: 1 - 100
* * @return

* The type of the content. Supported types are * text/plain, text/markdown, * application/json, and * application/vnd.amazonaws.connect.message.interactive.response * . *

*/ public String getContentType() { return contentType; } /** *

* The type of the content. Supported types are text/plain, * text/markdown, application/json, and * application/vnd.amazonaws.connect.message.interactive.response * . *

*

* Constraints:
* Length: 1 - 100
* * @param contentType

* The type of the content. Supported types are * text/plain, text/markdown, * application/json, and * application/vnd.amazonaws.connect.message.interactive.response * . *

*/ public void setContentType(String contentType) { this.contentType = contentType; } /** *

* The type of the content. Supported types are text/plain, * text/markdown, application/json, and * application/vnd.amazonaws.connect.message.interactive.response * . *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Length: 1 - 100
* * @param contentType

* The type of the content. Supported types are * text/plain, text/markdown, * application/json, and * application/vnd.amazonaws.connect.message.interactive.response * . *

* @return A reference to this updated object so that method calls can be * chained together. */ public ChatMessage withContentType(String contentType) { this.contentType = contentType; return this; } /** *

* The content of the chat message. *

* *

* Constraints:
* Length: 1 - 16384
* * @return

* The content of the chat message. *

* */ public String getContent() { return content; } /** *

* The content of the chat message. *

* *

* Constraints:
* Length: 1 - 16384
* * @param content

* The content of the chat message. *

* */ public void setContent(String content) { this.content = content; } /** *

* The content of the chat message. *

* *

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Length: 1 - 16384
* * @param content

* The content of the chat message. *

* * @return A reference to this updated object so that method calls can be * chained together. */ public ChatMessage withContent(String content) { this.content = content; 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 (getContentType() != null) sb.append("ContentType: " + getContentType() + ","); if (getContent() != null) sb.append("Content: " + getContent()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getContentType() == null) ? 0 : getContentType().hashCode()); hashCode = prime * hashCode + ((getContent() == null) ? 0 : getContent().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ChatMessage == false) return false; ChatMessage other = (ChatMessage) obj; if (other.getContentType() == null ^ this.getContentType() == null) return false; if (other.getContentType() != null && other.getContentType().equals(this.getContentType()) == false) return false; if (other.getContent() == null ^ this.getContent() == null) return false; if (other.getContent() != null && other.getContent().equals(this.getContent()) == false) return false; return true; } }