com.amazonaws.services.chime.model.ListChannelMessagesResult Maven / Gradle / Ivy
Show all versions of aws-java-sdk-chime Show documentation
/*
* Copyright 2019-2024 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.chime.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ListChannelMessagesResult extends com.amazonaws.AmazonWebServiceResult implements Serializable, Cloneable {
/**
*
* The ARN of the channel containing the requested messages.
*
*/
private String channelArn;
/**
*
* The token passed by previous API calls until all requested messages are returned.
*
*/
private String nextToken;
/**
*
* The information about, and content of, each requested message.
*
*/
private java.util.List channelMessages;
/**
*
* The ARN of the channel containing the requested messages.
*
*
* @param channelArn
* The ARN of the channel containing the requested messages.
*/
public void setChannelArn(String channelArn) {
this.channelArn = channelArn;
}
/**
*
* The ARN of the channel containing the requested messages.
*
*
* @return The ARN of the channel containing the requested messages.
*/
public String getChannelArn() {
return this.channelArn;
}
/**
*
* The ARN of the channel containing the requested messages.
*
*
* @param channelArn
* The ARN of the channel containing the requested messages.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ListChannelMessagesResult withChannelArn(String channelArn) {
setChannelArn(channelArn);
return this;
}
/**
*
* The token passed by previous API calls until all requested messages are returned.
*
*
* @param nextToken
* The token passed by previous API calls until all requested messages are returned.
*/
public void setNextToken(String nextToken) {
this.nextToken = nextToken;
}
/**
*
* The token passed by previous API calls until all requested messages are returned.
*
*
* @return The token passed by previous API calls until all requested messages are returned.
*/
public String getNextToken() {
return this.nextToken;
}
/**
*
* The token passed by previous API calls until all requested messages are returned.
*
*
* @param nextToken
* The token passed by previous API calls until all requested messages are returned.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ListChannelMessagesResult withNextToken(String nextToken) {
setNextToken(nextToken);
return this;
}
/**
*
* The information about, and content of, each requested message.
*
*
* @return The information about, and content of, each requested message.
*/
public java.util.List getChannelMessages() {
return channelMessages;
}
/**
*
* The information about, and content of, each requested message.
*
*
* @param channelMessages
* The information about, and content of, each requested message.
*/
public void setChannelMessages(java.util.Collection channelMessages) {
if (channelMessages == null) {
this.channelMessages = null;
return;
}
this.channelMessages = new java.util.ArrayList(channelMessages);
}
/**
*
* The information about, and content of, each requested message.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setChannelMessages(java.util.Collection)} or {@link #withChannelMessages(java.util.Collection)} if you
* want to override the existing values.
*
*
* @param channelMessages
* The information about, and content of, each requested message.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ListChannelMessagesResult withChannelMessages(ChannelMessageSummary... channelMessages) {
if (this.channelMessages == null) {
setChannelMessages(new java.util.ArrayList(channelMessages.length));
}
for (ChannelMessageSummary ele : channelMessages) {
this.channelMessages.add(ele);
}
return this;
}
/**
*
* The information about, and content of, each requested message.
*
*
* @param channelMessages
* The information about, and content of, each requested message.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ListChannelMessagesResult withChannelMessages(java.util.Collection channelMessages) {
setChannelMessages(channelMessages);
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 (getChannelArn() != null)
sb.append("ChannelArn: ").append(getChannelArn()).append(",");
if (getNextToken() != null)
sb.append("NextToken: ").append("***Sensitive Data Redacted***").append(",");
if (getChannelMessages() != null)
sb.append("ChannelMessages: ").append(getChannelMessages());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ListChannelMessagesResult == false)
return false;
ListChannelMessagesResult other = (ListChannelMessagesResult) obj;
if (other.getChannelArn() == null ^ this.getChannelArn() == null)
return false;
if (other.getChannelArn() != null && other.getChannelArn().equals(this.getChannelArn()) == false)
return false;
if (other.getNextToken() == null ^ this.getNextToken() == null)
return false;
if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == false)
return false;
if (other.getChannelMessages() == null ^ this.getChannelMessages() == null)
return false;
if (other.getChannelMessages() != null && other.getChannelMessages().equals(this.getChannelMessages()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getChannelArn() == null) ? 0 : getChannelArn().hashCode());
hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode());
hashCode = prime * hashCode + ((getChannelMessages() == null) ? 0 : getChannelMessages().hashCode());
return hashCode;
}
@Override
public ListChannelMessagesResult clone() {
try {
return (ListChannelMessagesResult) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}