public Association withDuration(Integer duration) {
        setDuration(duration);
        return this;
    }
<p>
The number of hours that an association can run on specified targets. After the resulting cutoff time passes,
associations that are currently running are cancelled, and no pending executions are started on remaining
targets.
</p>

@param duration
       The number of hours that an association can run on specified targets. After the resulting cutoff time
       passes, associations that are currently running are cancelled, and no pending executions are started on
       remaining targets.
@return Returns a reference to this object so that method calls can be chained together.
aws-java-sdk-ssm/src/main/java/com/amazonaws/services/simplesystemsmanagement/model/Association.java