本文整理了Java中com.amazonaws.services.ec2.model.Instance.setSecurityGroups()
方法的一些代码示例,展示了Instance.setSecurityGroups()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Instance.setSecurityGroups()
方法的具体详情如下:
包路径:com.amazonaws.services.ec2.model.Instance
类名称:Instance
方法名:setSecurityGroups
[英]One or more security groups for the instance.
[中]实例的一个或多个安全组。
代码示例来源:origin: aws/aws-sdk-java
/**
* <p>
* One or more security groups for the instance.
* </p>
*
* @param securityGroups
* One or more security groups for the instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withSecurityGroups(java.util.Collection<GroupIdentifier> securityGroups) {
setSecurityGroups(securityGroups);
return this;
}
代码示例来源:origin: aws/aws-sdk-java
/**
* <p>
* One or more security groups for the instance.
* </p>
* <p>
* <b>NOTE:</b> This method appends the values to the existing list (if any). Use
* {@link #setSecurityGroups(java.util.Collection)} or {@link #withSecurityGroups(java.util.Collection)} if you want
* to override the existing values.
* </p>
*
* @param securityGroups
* One or more security groups for the instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withSecurityGroups(GroupIdentifier... securityGroups) {
if (this.securityGroups == null) {
setSecurityGroups(new com.amazonaws.internal.SdkInternalList<GroupIdentifier>(securityGroups.length));
}
for (GroupIdentifier ele : securityGroups) {
this.securityGroups.add(ele);
}
return this;
}
代码示例来源:origin: aws-amplify/aws-sdk-android
/**
* One or more security groups for the instance.
* <p>
* Returns a reference to this object so that method calls can be chained together.
*
* @param securityGroups One or more security groups for the instance.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public Instance withSecurityGroups(GroupIdentifier... securityGroups) {
if (getSecurityGroups() == null) setSecurityGroups(new java.util.ArrayList<GroupIdentifier>(securityGroups.length));
for (GroupIdentifier value : securityGroups) {
getSecurityGroups().add(value);
}
return this;
}
代码示例来源:origin: com.amazonaws/aws-java-sdk-ec2
/**
* <p>
* One or more security groups for the instance.
* </p>
*
* @param securityGroups
* One or more security groups for the instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withSecurityGroups(java.util.Collection<GroupIdentifier> securityGroups) {
setSecurityGroups(securityGroups);
return this;
}
代码示例来源:origin: com.amazonaws/aws-java-sdk-ec2
/**
* <p>
* One or more security groups for the instance.
* </p>
* <p>
* <b>NOTE:</b> This method appends the values to the existing list (if any). Use
* {@link #setSecurityGroups(java.util.Collection)} or {@link #withSecurityGroups(java.util.Collection)} if you want
* to override the existing values.
* </p>
*
* @param securityGroups
* One or more security groups for the instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withSecurityGroups(GroupIdentifier... securityGroups) {
if (this.securityGroups == null) {
setSecurityGroups(new com.amazonaws.internal.SdkInternalList<GroupIdentifier>(securityGroups.length));
}
for (GroupIdentifier ele : securityGroups) {
this.securityGroups.add(ele);
}
return this;
}
内容来源于网络,如有侵权,请联系作者删除!