public GetRetainedMessageRequest withTopic(String topic) {
        setTopic(topic);
        return this;
    }
<p>
The topic name of the retained message to retrieve.
</p>

@param topic
       The topic name of the retained message to retrieve.
@return Returns a reference to this object so that method calls can be chained together.
aws-java-sdk-iot/src/main/java/com/amazonaws/services/iotdata/model/GetRetainedMessageRequest.java