/** * <p> * The EC2 instances associated with the group. * </p> * * @param instances * The EC2 instances associated with the group. * @return Returns a reference to this object so that method calls can be chained together. */ public AutoScalingGroup withInstances(java.util.Collection<Instance> instances) { setInstances(instances); return this; }
/** * <p> * The EC2 instances associated with the group. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setInstances(java.util.Collection)} or {@link #withInstances(java.util.Collection)} if you want to * override the existing values. * </p> * * @param instances * The EC2 instances associated with the group. * @return Returns a reference to this object so that method calls can be chained together. */ public AutoScalingGroup withInstances(Instance... instances) { if (this.instances == null) { setInstances(new com.amazonaws.internal.SdkInternalList<Instance>(instances.length)); } for (Instance ele : instances) { this.instances.add(ele); } return this; }
/** * <p> * The EC2 instances associated with the group. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param instances <p> * The EC2 instances associated with the group. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public AutoScalingGroup withInstances(java.util.Collection<Instance> instances) { setInstances(instances); return this; }