public Command withTargets(Target... targets) {
        if (this.targets == null) {
            setTargets(new com.amazonaws.internal.SdkInternalList<Target>(targets.length));
        }
        for (Target ele : targets) {
            this.targets.add(ele);
        }
        return this;
    }
<p>
An array of search criteria that targets managed nodes using a Key,Value combination that you specify. Targets is
required if you don't provide one or more managed node IDs in the call.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setTargets(java.util.Collection)} or {@link #withTargets(java.util.Collection)} if you want to override
the existing values.
</p>

@param targets
       An array of search criteria that targets managed nodes using a Key,Value combination that you specify.
       Targets is required if you don't provide one or more managed node IDs in the call.
@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/Command.java