public User withUsername(String username) {
        setUsername(username);
        return this;
    }
<p>
The username of the broker user. The following restrictions apply to broker usernames:
</p>
<ul>
<li>
<p>
For Amazon MQ for ActiveMQ brokers, this value can contain only alphanumeric characters, dashes, periods,
underscores, and tildes (- . _ ~). This value must be 2-100 characters long.
</p>
</li>
<li>
<p>
para>For Amazon MQ for RabbitMQ brokers, this value can contain only alphanumeric characters, dashes, periods,
underscores (- . _). This value must not contain a tilde (~) character. Amazon MQ prohibts using guest as a valid
usename. This value must be 2-100 characters long.
</p>
</para></li>
</ul>
<important>
<p>
Do not add personally identifiable information (PII) or other confidential or sensitive information in broker
usernames. Broker usernames are accessible to other Amazon Web Services services, including CloudWatch Logs.
Broker usernames are not intended to be used for private or sensitive data.
</p>
</important>

@param username
       The username of the broker user. The following restrictions apply to broker usernames:</p>
       <ul>
       <li>
       <p>
       For Amazon MQ for ActiveMQ brokers, this value can contain only alphanumeric characters, dashes, periods,
       underscores, and tildes (- . _ ~). This value must be 2-100 characters long.
       </p>
       </li>
       <li>
       <p>
       para>For Amazon MQ for RabbitMQ brokers, this value can contain only alphanumeric characters, dashes,
       periods, underscores (- . _). This value must not contain a tilde (~) character. Amazon MQ prohibts using
       guest as a valid usename. This value must be 2-100 characters long.
       </p>
       </para></li>
       </ul>
       <important>
       <p>
       Do not add personally identifiable information (PII) or other confidential or sensitive information in
       broker usernames. Broker usernames are accessible to other Amazon Web Services services, including
       CloudWatch Logs. Broker usernames are not intended to be used for private or sensitive data.
       </p>
@return Returns a reference to this object so that method calls can be chained together.
aws-java-sdk-mq/src/main/java/com/amazonaws/services/mq/model/User.java