/* * 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.chimesdkmessaging.model; import java.io.Serializable; public class SearchChannelsResult implements Serializable { /** *

* A list of the channels in the request. *

*/ private java.util.List channels; /** *

* The token returned from previous API responses until the number of * channels is reached. *

*

* Constraints:
* Length: 0 - 2048
* Pattern: .*
*/ private String nextToken; /** *

* A list of the channels in the request. *

* * @return

* A list of the channels in the request. *

*/ public java.util.List getChannels() { return channels; } /** *

* A list of the channels in the request. *

* * @param channels

* A list of the channels in the request. *

*/ public void setChannels(java.util.Collection channels) { if (channels == null) { this.channels = null; return; } this.channels = new java.util.ArrayList(channels); } /** *

* A list of the channels in the request. *

*

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

* A list of the channels in the request. *

* @return A reference to this updated object so that method calls can be * chained together. */ public SearchChannelsResult withChannels(ChannelSummary... channels) { if (getChannels() == null) { this.channels = new java.util.ArrayList(channels.length); } for (ChannelSummary value : channels) { this.channels.add(value); } return this; } /** *

* A list of the channels in the request. *

*

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

* A list of the channels in the request. *

* @return A reference to this updated object so that method calls can be * chained together. */ public SearchChannelsResult withChannels(java.util.Collection channels) { setChannels(channels); return this; } /** *

* The token returned from previous API responses until the number of * channels is reached. *

*

* Constraints:
* Length: 0 - 2048
* Pattern: .*
* * @return

* The token returned from previous API responses until the number * of channels is reached. *

*/ public String getNextToken() { return nextToken; } /** *

* The token returned from previous API responses until the number of * channels is reached. *

*

* Constraints:
* Length: 0 - 2048
* Pattern: .*
* * @param nextToken

* The token returned from previous API responses until the * number of channels is reached. *

*/ public void setNextToken(String nextToken) { this.nextToken = nextToken; } /** *

* The token returned from previous API responses until the number of * channels is reached. *

*

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

* Constraints:
* Length: 0 - 2048
* Pattern: .*
* * @param nextToken

* The token returned from previous API responses until the * number of channels is reached. *

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