/* * Copyright 2010-2021 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.iotdata.model; import java.io.Serializable; import com.amazonaws.AmazonWebServiceRequest; /** *
* Gets the details of a single retained message for the specified topic. *
** This action returns the message payload of the retained message, which can * incur messaging costs. To list only the topic names of the retained messages, * call ListRetainedMessages. *
** Requires permission to access the GetRetainedMessage action. *
** For more information about messaging costs, see IoT Core pricing - * Messaging. *
*/ public class GetRetainedMessageRequest extends AmazonWebServiceRequest implements Serializable { /** ** The topic name of the retained message to retrieve. *
*/ private String topic; /** ** The topic name of the retained message to retrieve. *
* * @return* The topic name of the retained message to retrieve. *
*/ public String getTopic() { return topic; } /** ** The topic name of the retained message to retrieve. *
* * @param topic* The topic name of the retained message to retrieve. *
*/ public void setTopic(String topic) { this.topic = topic; } /** ** The topic name of the retained message to retrieve. *
** Returns a reference to this object so that method calls can be chained * together. * * @param topic
* The topic name of the retained message to retrieve. *
* @return A reference to this updated object so that method calls can be * chained together. */ public GetRetainedMessageRequest withTopic(String topic) { this.topic = topic; 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 (getTopic() != null) sb.append("topic: " + getTopic()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getTopic() == null) ? 0 : getTopic().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof GetRetainedMessageRequest == false) return false; GetRetainedMessageRequest other = (GetRetainedMessageRequest) obj; if (other.getTopic() == null ^ this.getTopic() == null) return false; if (other.getTopic() != null && other.getTopic().equals(this.getTopic()) == false) return false; return true; } }